File tree Expand file tree Collapse file tree
src/renderer/store/preferences Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -148,12 +148,14 @@ const prefsSlice = createSlice({
148148 } ,
149149 renameStoredView ( state : AppPreferencesData , { payload } : PayloadAction < RenameStoredViewAction > ) {
150150 const oldIdx = state . storedViews . findIndex ( v => v . view === payload . old ) ;
151- const existing = state . storedViews . findIndex ( v => v . view === payload . new ) ;
151+ const existingIdx = state . storedViews . findIndex ( v => v . view === payload . new ) ;
152152 if ( ! oldIdx ) {
153- throw 'Could not find old view to rename - ' + payload . old ;
153+ alert ( 'Could not find old view to rename - ' + payload . old ) ;
154+ return ;
154155 }
155- if ( existing ) {
156- throw 'Cannot override existing view during a rename - ' + payload . old + ' to ' + payload . new ;
156+ if ( existingIdx > - 1 ) {
157+ alert ( 'Cannot override existing view during a rename - ' + payload . old + ' to ' + payload . new ) ;
158+ return ;
157159 }
158160 state . storedViews [ oldIdx ] . view = payload . new ;
159161 } ,
You can’t perform that action at this time.
0 commit comments