feat(core): make permission and invoice offline available (#8123)

This commit is contained in:
EYHN
2024-09-05 15:11:27 +00:00
parent 8be67dce82
commit f4db4058f8
17 changed files with 236 additions and 186 deletions

View File

@@ -3,7 +3,6 @@ import {
type GraphQLQuery,
type QueryOptions,
type QueryResponse,
UserFriendlyError,
} from '@affine/graphql';
import { fromPromise, Service } from '@toeverything/infra';
import type { Observable } from 'rxjs';
@@ -39,13 +38,11 @@ export class GraphQLService extends Service {
try {
return await this.rawGql(options);
} catch (err) {
const standardError = UserFriendlyError.fromAnyError(err);
if (standardError.status === 403) {
if (err instanceof BackendError && err.status === 403) {
this.framework.get(AuthService).session.revalidate();
}
throw new BackendError(standardError);
throw err;
}
};
}