@@ -3,14 +3,7 @@ import { AppEvent, AppEventEmitter } from "../common/events";
33import { ValueResult } from "../common/value-result" ;
44import { DisposableObject } from "../common/disposable-object" ;
55import { DbConfigStore } from "./config/db-config-store" ;
6- import {
7- DbItem ,
8- DbItemKind ,
9- DbListKind ,
10- LocalDatabaseDbItem ,
11- LocalListDbItem ,
12- RemoteUserDefinedListDbItem ,
13- } from "./db-item" ;
6+ import { DbItem , RemoteUserDefinedListDbItem } from "./db-item" ;
147import {
158 updateExpandedItem ,
169 replaceExpandedItem ,
@@ -116,31 +109,15 @@ export class DbManager extends DisposableObject {
116109 await this . dbConfigStore . addRemoteOwner ( owner ) ;
117110 }
118111
119- public async addNewList (
120- listKind : DbListKind ,
121- listName : string ,
122- ) : Promise < void > {
123- switch ( listKind ) {
124- case DbListKind . Local :
125- await this . dbConfigStore . addLocalList ( listName ) ;
126- break ;
127- case DbListKind . Remote :
128- await this . dbConfigStore . addRemoteList ( listName ) ;
129- break ;
130- default :
131- throw Error ( `Unknown list kind '${ listKind } '` ) ;
132- }
112+ public async addNewList ( listName : string ) : Promise < void > {
113+ await this . dbConfigStore . addRemoteList ( listName ) ;
133114 }
134115
135116 public async renameList (
136- currentDbItem : LocalListDbItem | RemoteUserDefinedListDbItem ,
117+ currentDbItem : RemoteUserDefinedListDbItem ,
137118 newName : string ,
138119 ) : Promise < void > {
139- if ( currentDbItem . kind === DbItemKind . LocalList ) {
140- await this . dbConfigStore . renameLocalList ( currentDbItem , newName ) ;
141- } else if ( currentDbItem . kind === DbItemKind . RemoteUserDefinedList ) {
142- await this . dbConfigStore . renameRemoteList ( currentDbItem , newName ) ;
143- }
120+ await this . dbConfigStore . renameRemoteList ( currentDbItem , newName ) ;
144121
145122 const newDbItem = { ...currentDbItem , listName : newName } ;
146123 const newExpandedItems = replaceExpandedItem (
@@ -152,26 +129,8 @@ export class DbManager extends DisposableObject {
152129 await this . setExpandedItems ( newExpandedItems ) ;
153130 }
154131
155- public async renameLocalDb (
156- currentDbItem : LocalDatabaseDbItem ,
157- newName : string ,
158- ) : Promise < void > {
159- await this . dbConfigStore . renameLocalDb (
160- currentDbItem ,
161- newName ,
162- currentDbItem . parentListName ,
163- ) ;
164- }
165-
166- public doesListExist ( listKind : DbListKind , listName : string ) : boolean {
167- switch ( listKind ) {
168- case DbListKind . Local :
169- return this . dbConfigStore . doesLocalListExist ( listName ) ;
170- case DbListKind . Remote :
171- return this . dbConfigStore . doesRemoteListExist ( listName ) ;
172- default :
173- throw Error ( `Unknown list kind '${ listKind } '` ) ;
174- }
132+ public doesListExist ( listName : string ) : boolean {
133+ return this . dbConfigStore . doesRemoteListExist ( listName ) ;
175134 }
176135
177136 public doesRemoteOwnerExist ( owner : string ) : boolean {
@@ -182,10 +141,6 @@ export class DbManager extends DisposableObject {
182141 return this . dbConfigStore . doesRemoteDbExist ( nwo , listName ) ;
183142 }
184143
185- public doesLocalDbExist ( dbName : string , listName ?: string ) : boolean {
186- return this . dbConfigStore . doesLocalDbExist ( dbName , listName ) ;
187- }
188-
189144 private getExpandedItems ( ) : ExpandedDbItem [ ] {
190145 const items = this . app . workspaceState . get < ExpandedDbItem [ ] > (
191146 DbManager . DB_EXPANDED_STATE_KEY ,
0 commit comments