Skip to content

Commit

Permalink
domains: Batch-update domains on tab drag.
Browse files Browse the repository at this point in the history
  • Loading branch information
kanishk98 committed Aug 20, 2019
1 parent b879825 commit 98f40de
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/renderer/js/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ class ServerManagerView {
el.setAttribute('data-tab-id', index.toString());
});
this.servers = newServers;
DomainUtil.batchUpdateDomain(this.servers);
this.reloadView(false);
}

Expand Down
7 changes: 7 additions & 0 deletions app/renderer/js/utils/domain-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ class DomainUtil {
this.db.push(`/domains[${index}]`, server, true);
}

batchUpdateDomain(servers: Domain[]): void {
this.db.delete('/domains');
for (const server of servers) {
this.db.push('/domains[]', server, true);
}
}

addDomain(server: any): Promise<void> {
const { ignoreCerts } = server;
return new Promise(resolve => {
Expand Down

0 comments on commit 98f40de

Please sign in to comment.