Skip to content

Commit

Permalink
fix: remember tab error
Browse files Browse the repository at this point in the history
  • Loading branch information
scarqin committed Sep 28, 2022
1 parent 06dee01 commit 9e1d9c5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
10 changes: 0 additions & 10 deletions src/workbench/browser/src/app/pages/api/api.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,6 @@ export class ApiComponent implements OnInit, OnDestroy {
private remoteService: RemoteService,
private store: Store
) {
//Select demo api when first open Eoapi
if (!window.localStorage.getItem('local_TabCache')) {
this.router.navigate(['/home/api/http/test'], {
queryParams: { pageID: Date.now(), uuid: 1 },
});
setTimeout(() => {
const testBtn = document.getElementById('btn-test');
testBtn && testBtn.click();
}, 600);
}
}
get envUuid(): number | null {
return Number(localStorage.getItem('env:selected')) || 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,17 @@ export class ApiTestComponent implements OnInit, OnDestroy {
private messageService: MessageService,
private lang: LanguageService
) {
//Select demo api when first open Eoapi
if (!window.localStorage.getItem('local_TabCache')) {
this.router.navigate(['/home/api/http/test'], {
queryParams: { pageID: Date.now(), uuid: 1 },
});
setTimeout(() => {
const testBtn = document.getElementById('btn-test');
testBtn && testBtn.click();
}, 600);
}

this.initBasicForm();
this.testServer.init((message) => {
this.receiveMessage(message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ export class ApiTabStorageService {
* @param data
*/
setPersistenceStorage(selectedIndex, opts) {
return;
//! remote datasource may change
// if (this.dataSource.dataSourceType === 'http') {return;}
let tabsByID = Object.fromEntries(this.tabsByID);
Expand Down

0 comments on commit 9e1d9c5

Please sign in to comment.