@@ -7,6 +7,8 @@ import {Menu, app, dialog, session} from "@electron/remote";
77import * as remote from "@electron/remote" ;
88import * as Sentry from "@sentry/electron/renderer" ;
99
10+ import Sortable from "sortablejs" ;
11+
1012import type { Config } from "../../common/config-util.js" ;
1113import * as ConfigUtil from "../../common/config-util.js" ;
1214import * as DNDUtil from "../../common/dnd-util.js" ;
@@ -28,7 +30,6 @@ import {initializeTray} from "./tray.js";
2830import { ipcRenderer } from "./typed-ipc-renderer.js" ;
2931import * as DomainUtil from "./utils/domain-util.js" ;
3032import ReconnectUtil from "./utils/reconnect-util.js" ;
31- import Sortable from "sortablejs" ;
3233
3334Sentry . init ( { } ) ;
3435
@@ -242,11 +243,11 @@ export class ServerManagerView {
242243 animation : 150 ,
243244 onEnd : ( event : Sortable . SortableEvent ) => {
244245 // 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 ) ;
246247
247248 // 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 ) ;
250251
251252 // Reload the app to give the tabs their new indexes
252253 ipcRenderer . send ( "reload-full-app" ) ;
0 commit comments