Skip to content

Commit

Permalink
fix(abc:reuse-tab): fix cache (#1611)
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk authored Jul 16, 2023
1 parent cd91a5a commit 3185ab8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/abc/reuse-tab/reuse-tab.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@ export class ReuseTabService implements OnDestroy {
}
/** 自定义当前标题 */
set title(value: string | ReuseTitle) {
if (this.cached == null) return;

const url = this.curUrl;
if (typeof value === 'string') value = { text: value };
this.cached.title[url] = value;
Expand Down Expand Up @@ -373,7 +371,11 @@ export class ReuseTabService implements OnDestroy {
@Optional() @Inject(REUSE_TAB_CACHED_MANAGER) private cached: ReuseTabCachedManager,
@Optional() @Inject(REUSE_TAB_STORAGE_KEY) private stateKey: string,
@Optional() @Inject(REUSE_TAB_STORAGE_STATE) private stateSrv: ReuseTabStorageState
) {}
) {
if (this.cached == null) {
this.cached = { list: [], title: {}, closable: {} };
}
}

init(): void {
this.initScroll();
Expand Down

0 comments on commit 3185ab8

Please sign in to comment.