fix(web): disable subscription sharing on demo

This commit is contained in:
Karol Sójko
2023-02-03 06:41:00 +01:00
parent 361c75502e
commit de5973e15f
3 changed files with 21 additions and 2 deletions

View File

@@ -77,6 +77,7 @@ export class SNSessionManager
{
private user?: Responses.User
private isSessionRenewChallengePresented = false
private session?: Session | LegacySession
constructor(
private diskStorageService: DiskStorageService,
@@ -149,6 +150,8 @@ export class SNSessionManager
}
private setSession(session: Session | LegacySession, persist = true): void {
this.session = session
if (session instanceof Session) {
this.httpService.setSession(session)
}
@@ -170,6 +173,18 @@ export class SNSessionManager
return this.user
}
isCurrentSessionReadOnly(): boolean | undefined {
if (this.session === undefined) {
return undefined
}
if (this.session instanceof LegacySession) {
return false
}
return this.session.isReadOnly()
}
public getSureUser() {
return this.user as Responses.User
}