Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async onFileSelected(file: File) {
try {
const data = await this.sketchService.loadSketchFile(file);
this.isDragging$.next(false);
// Note: these actions need to be run in sequence!
this.store.dispatch([
new ResetUiSettings(),
new CurrentData(data),
new Navigate(['/editor/preview'])
]);
} catch (error) {
this.store.dispatch(new InformUser(error, ErrorType.Runtime));
throw error;
}
}
function () {
this.oauthService.logOut();
this.store.dispatch(new Navigate(['/'], null, {
state: { redirectUrl: this.store.selectSnapshot(RouterState).state.url },
}));
this.store.dispatch(new GetAppConfiguration());
};
// required for dynamic component
onLoginRedirect(ctx: StateContext) {
console.log('onLoginRedirect, navigating to /auth/login');
ctx.dispatch(new Navigate(['/auth/login']));
}
logout({ dispatch, setState }: StateContext) {
setState(authStatusStateDefaults);
dispatch(new Navigate(['/login']));
}
}
tap(() => {
const redirectUrl = snq(() => window.history.state).redirectUrl || (this.options || {}).redirectUrl || '/';
this.store.dispatch(new Navigate([redirectUrl]));
}),
catchError(err => {
logout() {
this.oauthService.logOut();
this.store.dispatch(
new Navigate(['/'], null, {
state: { redirectUrl: this.store.selectSnapshot(RouterState).state.url },
}),
);
this.store.dispatch(new GetAppConfiguration());
}
}
logout() {
this.oauthService.logOut();
this.store.dispatch(new Navigate(['/'], null, {
state: { redirectUrl: this.store.selectSnapshot(RouterState).state.url },
}));
this.store.dispatch(new GetAppConfiguration());
}
}
onTabSelect(ix: number): void {
const route = this.tabs[ix].route;
this.store.dispatch(new Navigate([route]));
}
_ => {
this.snack.open(isNew ? 'Notification Created!' : 'Notification Updated!', 'OK', { duration: 5000 });
this.store.dispatch(new Navigate(['/admin/notifications']));
},
error => this.snack.open(error, 'OK', { duration: 10000 }),
loadTable(tableName: string): void {
this.store.dispatch(new Navigate(['/ddb', tableName]));
}