@@ -7,6 +7,8 @@ import {Menu, app, dialog, session} from "@electron/remote";
7
7
import * as remote from "@electron/remote" ;
8
8
import * as Sentry from "@sentry/electron/renderer" ;
9
9
10
+ import Sortable from "sortablejs" ;
11
+
10
12
import type { Config } from "../../common/config-util.js" ;
11
13
import * as ConfigUtil from "../../common/config-util.js" ;
12
14
import * as DNDUtil from "../../common/dnd-util.js" ;
@@ -28,7 +30,6 @@ import {initializeTray} from "./tray.js";
28
30
import { ipcRenderer } from "./typed-ipc-renderer.js" ;
29
31
import * as DomainUtil from "./utils/domain-util.js" ;
30
32
import ReconnectUtil from "./utils/reconnect-util.js" ;
31
- import Sortable from "sortablejs" ;
32
33
33
34
Sentry . init ( { } ) ;
34
35
@@ -242,11 +243,11 @@ export class ServerManagerView {
242
243
animation : 150 ,
243
244
onEnd : ( event : Sortable . SortableEvent ) => {
244
245
// Update the domain order in the database
245
- DomainUtil . updateDomainOrder ( event . oldIndex || 0 , event . newIndex || 0 ) ;
246
+ DomainUtil . updateDomainOrder ( event . oldIndex ?? 0 , event . newIndex ?? 0 ) ;
246
247
247
248
// Update the current active tab index
248
- this . activeTabIndex = event . newIndex || 0 ;
249
- ConfigUtil . setConfigItem ( "lastActiveTab" , event . newIndex || 0 ) ;
249
+ this . activeTabIndex = event . newIndex ?? 0 ;
250
+ ConfigUtil . setConfigItem ( "lastActiveTab" , event . newIndex ?? 0 ) ;
250
251
251
252
// Reload the app to give the tabs their new indexes
252
253
ipcRenderer . send ( "reload-full-app" ) ;
0 commit comments