From c6f0c84935db37e2a18578a081404d84292fe36a Mon Sep 17 00:00:00 2001 From: V Date: Sat, 22 Apr 2023 03:17:00 +0200 Subject: [PATCH] PinDMs: Fix alt up/down being weird (#957) --- src/plugins/pinDms/index.tsx | 4 ++-- src/plugins/pinDms/settings.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/pinDms/index.tsx b/src/plugins/pinDms/index.tsx index a7f35a2b9..249dcd276 100644 --- a/src/plugins/pinDms/index.tsx +++ b/src/plugins/pinDms/index.tsx @@ -21,7 +21,7 @@ import definePlugin from "@utils/types"; import { Channel } from "discord-types/general"; import { addContextMenus, removeContextMenus } from "./contextMenus"; -import { getPinAt, isPinned, settings, snapshotArray, usePinnedDms } from "./settings"; +import { getPinAt, isPinned, settings, snapshotArray, sortedSnapshot, usePinnedDms } from "./settings"; export default definePlugin({ name: "PinDMs", @@ -44,7 +44,7 @@ export default definePlugin({ }, isPinned, - getSnapshot: () => snapshotArray, + getSnapshot: sortedSnapshot, getScrollOffset(channelId: string, rowHeight: number, padding: number, preRenderedChildren: number, originalOffset: number) { if (!isPinned(channelId)) diff --git a/src/plugins/pinDms/settings.ts b/src/plugins/pinDms/settings.ts index 092a0db7a..e8bd267a9 100644 --- a/src/plugins/pinDms/settings.ts +++ b/src/plugins/pinDms/settings.ts @@ -71,7 +71,7 @@ export function togglePin(id: string) { save([...snapshot]); } -function sortedSnapshot() { +export function sortedSnapshot() { requireSnapshot(); if (settings.store.pinOrder === PinOrder.LastMessage) return PrivateChannelSortStore.getPrivateChannelIds().filter(isPinned);