From 6758f3d390c115a418d97474bf62ac22c2265e82 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sat, 1 Jun 2024 12:03:36 -0700 Subject: [PATCH] refac: disable sortable on mobile --- src/lib/components/workspace/Models.svelte | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/lib/components/workspace/Models.svelte b/src/lib/components/workspace/Models.svelte index 43f0cad67..dcecef819 100644 --- a/src/lib/components/workspace/Models.svelte +++ b/src/lib/components/workspace/Models.svelte @@ -7,7 +7,7 @@ import { onMount, getContext, tick } from 'svelte'; - import { WEBUI_NAME, modelfiles, models, settings, user } from '$lib/stores'; + import { WEBUI_NAME, mobile, models, settings, user } from '$lib/stores'; import { addNewModel, deleteModelById, getModelInfos, updateModelById } from '$lib/apis/models'; import { deleteModel } from '$lib/apis/ollama'; @@ -170,14 +170,16 @@ console.log(localModelfiles); } - // SortableJS - sortable = new Sortable(document.getElementById('model-list'), { - animation: 150, - onUpdate: async (event) => { - console.log(event); - positionChangeHanlder(); - } - }); + if (!$mobile) { + // SortableJS + sortable = new Sortable(document.getElementById('model-list'), { + animation: 150, + onUpdate: async (event) => { + console.log(event); + positionChangeHanlder(); + } + }); + } });