fix: proper reload of ext data
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import { RootScopeMessages } from './../../messages';
|
||||||
import { WebApplication } from '@/ui_models/application';
|
import { WebApplication } from '@/ui_models/application';
|
||||||
import { SNComponent, ComponentAction, LiveItem } from 'snjs';
|
import { SNComponent, ComponentAction, LiveItem } from 'snjs';
|
||||||
import { WebDirective } from './../../types';
|
import { WebDirective } from './../../types';
|
||||||
@@ -199,7 +200,7 @@ class ComponentViewCtrl implements ComponentViewScope {
|
|||||||
this.error = undefined;
|
this.error = undefined;
|
||||||
}
|
}
|
||||||
if (this.expired && doManualReload) {
|
if (this.expired && doManualReload) {
|
||||||
this.$rootScope.$broadcast('reload-ext-dat');
|
this.$rootScope.$broadcast(RootScopeMessages.ReloadExtendedData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
4
app/assets/javascripts/messages.ts
Normal file
4
app/assets/javascripts/messages.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export enum RootScopeMessages {
|
||||||
|
ReloadExtendedData = 'reload-ext-data',
|
||||||
|
NewUpdateAvailable = 'new-update-available'
|
||||||
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { RootScopeMessages } from './../../messages';
|
||||||
import { WebDirective } from '@/types';
|
import { WebDirective } from '@/types';
|
||||||
import { getPlatformString } from '@/utils';
|
import { getPlatformString } from '@/utils';
|
||||||
import template from './application-view.pug';
|
import template from './application-view.pug';
|
||||||
@@ -82,7 +83,7 @@ class ApplicationViewCtrl extends PureViewCtrl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onUpdateAvailable() {
|
onUpdateAvailable() {
|
||||||
this.$rootScope!.$broadcast('new-update-available');
|
this.$rootScope!.$broadcast(RootScopeMessages.NewUpdateAvailable);
|
||||||
};
|
};
|
||||||
|
|
||||||
/** @override */
|
/** @override */
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { RootScopeMessages } from './../../messages';
|
||||||
import { ApplicationGroup } from '@/ui_models/application_group';
|
import { ApplicationGroup } from '@/ui_models/application_group';
|
||||||
import { FooterStatus, WebDirective } from '@/types';
|
import { FooterStatus, WebDirective } from '@/types';
|
||||||
import { dateToLocalizedString, preventRefreshing } from '@/utils';
|
import { dateToLocalizedString, preventRefreshing } from '@/utils';
|
||||||
@@ -171,10 +172,10 @@ class FooterViewCtrl extends PureViewCtrl<{}, {
|
|||||||
}
|
}
|
||||||
|
|
||||||
addRootScopeListeners() {
|
addRootScopeListeners() {
|
||||||
this.rootScopeListener1 = this.$rootScope.$on("reload-ext-data", () => {
|
this.rootScopeListener1 = this.$rootScope.$on(RootScopeMessages.ReloadExtendedData, () => {
|
||||||
this.reloadExtendedData();
|
this.reloadExtendedData();
|
||||||
});
|
});
|
||||||
this.rootScopeListener2 = this.$rootScope.$on("new-update-available", () => {
|
this.rootScopeListener2 = this.$rootScope.$on(RootScopeMessages.NewUpdateAvailable, () => {
|
||||||
this.$timeout(() => {
|
this.$timeout(() => {
|
||||||
this.onNewUpdateAvailable();
|
this.onNewUpdateAvailable();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
.sk-p
|
.sk-p
|
||||||
| Extensions are in a read-only state.
|
| Extensions are in a read-only state.
|
||||||
.right
|
.right
|
||||||
.sk-app-bar-item(ng-click='ctrl.reloadIframe()')
|
.sk-app-bar-item(ng-click='ctrl.reloadStatus(true)')
|
||||||
.sk-button.info
|
.sk-button.info
|
||||||
.sk-label Reload
|
.sk-label Reload
|
||||||
.sk-app-bar-item
|
.sk-app-bar-item
|
||||||
|
|||||||
4
dist/@types/app/assets/javascripts/messages.d.ts
vendored
Normal file
4
dist/@types/app/assets/javascripts/messages.d.ts
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export declare enum RootScopeMessages {
|
||||||
|
ReloadExtendedData = "reload-ext-data",
|
||||||
|
NewUpdateAvailable = "new-update-available"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user