More webapp changes+fixes
This commit is contained in:
@@ -7,7 +7,6 @@ export interface Channel {
|
||||
display_name: string;
|
||||
description_name: string | null;
|
||||
subscribe_key?: string;
|
||||
send_key?: string;
|
||||
timestamp_created: string;
|
||||
timestamp_lastsent: string | null;
|
||||
messages_sent: number;
|
||||
@@ -34,8 +33,7 @@ export interface CreateChannelRequest {
|
||||
export interface UpdateChannelRequest {
|
||||
display_name?: string;
|
||||
description_name?: string;
|
||||
subscribe_key?: string;
|
||||
send_key?: string;
|
||||
subscribe_key?: boolean; // RefreshSubscribeKey
|
||||
}
|
||||
|
||||
export interface ChannelListResponse {
|
||||
|
||||
@@ -17,8 +17,8 @@ export class AuthService {
|
||||
}
|
||||
|
||||
private loadFromStorage(): void {
|
||||
const userId = sessionStorage.getItem(USER_ID_KEY);
|
||||
const adminKey = sessionStorage.getItem(ADMIN_KEY_KEY);
|
||||
const userId = localStorage.getItem(USER_ID_KEY);
|
||||
const adminKey = localStorage.getItem(ADMIN_KEY_KEY);
|
||||
if (userId && adminKey) {
|
||||
this.userId.set(userId);
|
||||
this.adminKey.set(adminKey);
|
||||
@@ -26,15 +26,15 @@ export class AuthService {
|
||||
}
|
||||
|
||||
login(userId: string, adminKey: string): void {
|
||||
sessionStorage.setItem(USER_ID_KEY, userId);
|
||||
sessionStorage.setItem(ADMIN_KEY_KEY, adminKey);
|
||||
localStorage.setItem(USER_ID_KEY, userId);
|
||||
localStorage.setItem(ADMIN_KEY_KEY, adminKey);
|
||||
this.userId.set(userId);
|
||||
this.adminKey.set(adminKey);
|
||||
}
|
||||
|
||||
logout(): void {
|
||||
sessionStorage.removeItem(USER_ID_KEY);
|
||||
sessionStorage.removeItem(ADMIN_KEY_KEY);
|
||||
localStorage.removeItem(USER_ID_KEY);
|
||||
localStorage.removeItem(ADMIN_KEY_KEY);
|
||||
this.userId.set(null);
|
||||
this.adminKey.set(null);
|
||||
}
|
||||
|
||||
@@ -16,9 +16,7 @@ export class SettingsService {
|
||||
|
||||
private loadFromStorage(): void {
|
||||
const stored = localStorage.getItem(EXPERT_MODE_KEY);
|
||||
if (stored === 'true') {
|
||||
this._expertMode.set(true);
|
||||
}
|
||||
this._expertMode.set(stored === 'true');
|
||||
}
|
||||
|
||||
setExpertMode(enabled: boolean): void {
|
||||
|
||||
Reference in New Issue
Block a user