Просмотр исходного кода

show app update notification in page when system notification is disabled

MaysWind 2 лет назад
Родитель
Сommit
7e1c5b3e78
1 измененных файлов с 15 добавлено и 5 удалено
  1. 15 5
      app/scripts/core/root.js

+ 15 - 5
app/scripts/core/root.js

@@ -232,11 +232,21 @@
                     var latestVersion = response.data.tag_name;
 
                     if (ariaNgVersionService.compareVersion(ariaNgVersionService.getBuildVersionNumber(), latestVersion) < 0) {
-                        ariaNgNotificationService.notifyViaBrowser('AriaNg Native Updates', 'A new version has been released', {
-                            contentParams: {
-                                version: latestVersion
-                            }
-                        });
+                        if (ariaNgSettingService.getBrowserNotification()) {
+                            ariaNgNotificationService.notifyViaBrowser('AriaNg Native Updates', 'A new version has been released', {
+                                contentParams: {
+                                    version: latestVersion
+                                }
+                            });
+                        } else {
+                            ariaNgNotificationService.notifyInPage('', 'A new version has been released', {
+                                delay: false,
+                                type: 'info',
+                                contentParams: {
+                                    version: latestVersion
+                                }
+                            });
+                        }
                     }
                 }).catch(function onError(response) {
                     ariaNgLogService.error('[root.autoCheckUpdates] failed to get latest version', response);