PinDMs: Fix alt up/down being weird (#957)
This commit is contained in:
parent
a8d017811d
commit
c6f0c84935
|
@ -21,7 +21,7 @@ import definePlugin from "@utils/types";
|
||||||
import { Channel } from "discord-types/general";
|
import { Channel } from "discord-types/general";
|
||||||
|
|
||||||
import { addContextMenus, removeContextMenus } from "./contextMenus";
|
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({
|
export default definePlugin({
|
||||||
name: "PinDMs",
|
name: "PinDMs",
|
||||||
|
@ -44,7 +44,7 @@ export default definePlugin({
|
||||||
},
|
},
|
||||||
|
|
||||||
isPinned,
|
isPinned,
|
||||||
getSnapshot: () => snapshotArray,
|
getSnapshot: sortedSnapshot,
|
||||||
|
|
||||||
getScrollOffset(channelId: string, rowHeight: number, padding: number, preRenderedChildren: number, originalOffset: number) {
|
getScrollOffset(channelId: string, rowHeight: number, padding: number, preRenderedChildren: number, originalOffset: number) {
|
||||||
if (!isPinned(channelId))
|
if (!isPinned(channelId))
|
||||||
|
|
|
@ -71,7 +71,7 @@ export function togglePin(id: string) {
|
||||||
save([...snapshot]);
|
save([...snapshot]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function sortedSnapshot() {
|
export function sortedSnapshot() {
|
||||||
requireSnapshot();
|
requireSnapshot();
|
||||||
if (settings.store.pinOrder === PinOrder.LastMessage)
|
if (settings.store.pinOrder === PinOrder.LastMessage)
|
||||||
return PrivateChannelSortStore.getPrivateChannelIds().filter(isPinned);
|
return PrivateChannelSortStore.getPrivateChannelIds().filter(isPinned);
|
||||||
|
|
Loading…
Reference in a new issue