mirror of
https://github.com/HeyPuter/puter.git
synced 2026-08-26 07:57:10 +00:00
fix(dashboard): ignore stray pointers and no-op drags
- Filter drag pointermove/up/cancel by pointerId so a second finger can't hijack or prematurely end an in-progress reorder. - Only persist a new order when the drop actually changed it, so an accidental long-press or drop-in-place doesn't freeze the default ordering into a custom one.
This commit is contained in:
@@ -792,8 +792,15 @@ const TabApps = {
|
||||
if ( commit ) {
|
||||
const names = d.$el_window.find('.myapps-page .myapps-tile').toArray()
|
||||
.map(t => t.getAttribute('data-app-name'));
|
||||
this._apps = this._reorderAppsByNames(names);
|
||||
this.saveOrder();
|
||||
const current = this._apps.map(a => a.name);
|
||||
// Only persist when the order actually changed, so an accidental
|
||||
// long-press or drop-in-place doesn't freeze the default ordering.
|
||||
const changed = names.length !== current.length
|
||||
|| names.some((name, i) => name !== current[i]);
|
||||
if ( changed ) {
|
||||
this._apps = this._reorderAppsByNames(names);
|
||||
this.saveOrder();
|
||||
}
|
||||
}
|
||||
|
||||
const ghost = d.ghost;
|
||||
|
||||
Reference in New Issue
Block a user