mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Revert part of the recent tweaks to AppHeader
Summary: In non-SaaS Grist, the AppHeader will no longer link to templates page. Also, the last visited site is now reset when switching accounts. Test Plan: Existing tests. Reviewers: jarek Reviewed By: jarek Differential Revision: https://phab.getgrist.com/D4048
This commit is contained in:
@@ -128,6 +128,7 @@ export interface AppModel {
|
||||
isOwnerOrEditor(): boolean; // If user is an owner or editor of this org
|
||||
/** Creates an computed observable to dismiss a popup or check if it was dismissed */
|
||||
dismissedPopup(name: DismissedPopup): Observable<boolean>;
|
||||
switchUser(user: FullUser, org?: string): Promise<void>;
|
||||
}
|
||||
|
||||
export class TopAppModelImpl extends Disposable implements TopAppModel {
|
||||
@@ -402,6 +403,11 @@ export class AppModelImpl extends Disposable implements AppModel {
|
||||
return computed;
|
||||
}
|
||||
|
||||
public async switchUser(user: FullUser, org?: string) {
|
||||
await this.api.setSessionActive(user.email, org);
|
||||
this.lastVisitedOrgDomain.set(null);
|
||||
}
|
||||
|
||||
private _updateLastVisitedOrgDomain({doc, org}: IGristUrlState, availableOrgs: Organization[]) {
|
||||
if (
|
||||
!org ||
|
||||
|
||||
Reference in New Issue
Block a user