Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions src/stores/ServicesStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1078,18 +1078,21 @@
}

@action _reorderService({ oldIndex, newIndex }) {
const { showDisabledServices } = this.stores.settings.all.app;
const oldEnabledSortIndex = showDisabledServices
? oldIndex
: this.all.indexOf(this.enabled[oldIndex]);
const newEnabledSortIndex = showDisabledServices
? newIndex
: this.all.indexOf(this.enabled[newIndex]);
// Use the currently displayed services for index mapping
const displayedServices = this.allDisplayed;
const oldId = displayedServices[oldIndex]?.id;
const newId = displayedServices[newIndex]?.id;
if (!oldId || !newId) return;

// Find the actual indices in the full this.all array
const oldActualIndex = this.all.findIndex(s => s.id === oldId);
const newActualIndex = this.all.findIndex(s => s.id === newId);
if (oldActualIndex === -1 || newActualIndex === -1) return;

this.all.splice(

Check failure on line 1092 in src/stores/ServicesStore.ts

View workflow job for this annotation

GitHub Actions / ubuntu

Replace `⏎······newActualIndex,⏎······0,⏎······this.all.splice(oldActualIndex,·1)[0],⏎····` with `newActualIndex,·0,·this.all.splice(oldActualIndex,·1)[0]`

Check failure on line 1092 in src/stores/ServicesStore.ts

View workflow job for this annotation

GitHub Actions / windows

Replace `⏎······newActualIndex,⏎······0,⏎······this.all.splice(oldActualIndex,·1)[0],⏎····` with `newActualIndex,·0,·this.all.splice(oldActualIndex,·1)[0]`

Check failure on line 1092 in src/stores/ServicesStore.ts

View workflow job for this annotation

GitHub Actions / macos

Replace `⏎······newActualIndex,⏎······0,⏎······this.all.splice(oldActualIndex,·1)[0],⏎····` with `newActualIndex,·0,·this.all.splice(oldActualIndex,·1)[0]`
newEnabledSortIndex,
newActualIndex,
0,
this.all.splice(oldEnabledSortIndex, 1)[0],
this.all.splice(oldActualIndex, 1)[0],
);

const services = {};
Expand Down
Loading