pull/5150/merge
Rashel Shah 2 days ago committed by GitHub
commit e45a5660a9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

10019
web/package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -31,11 +31,17 @@ const Archived = observer(() => {
listSort={(memos: Memo[]) =>
memos
.filter((memo) => memo.state === State.ARCHIVED)
.sort((a, b) =>
viewStore.state.orderByTimeAsc
.sort((a, b) => {
if (a.pinned && !b.pinned) {
return -1;
}
if (!a.pinned && b.pinned) {
return 1;
}
return viewStore.state.orderByTimeAsc
? dayjs(a.displayTime).unix() - dayjs(b.displayTime).unix()
: dayjs(b.displayTime).unix() - dayjs(a.displayTime).unix(),
)
: dayjs(b.displayTime).unix() - dayjs(a.displayTime).unix();
})
}
state={State.ARCHIVED}
orderBy={viewStore.state.orderByTimeAsc ? "display_time asc" : "display_time desc"}

@ -20,11 +20,17 @@ const Explore = observer(() => {
listSort={(memos: Memo[]) =>
memos
.filter((memo) => memo.state === State.NORMAL)
.sort((a, b) =>
viewStore.state.orderByTimeAsc
.sort((a, b) => {
if (a.pinned && !b.pinned) {
return -1;
}
if (!a.pinned && b.pinned) {
return 1;
}
return viewStore.state.orderByTimeAsc
? dayjs(a.displayTime).unix() - dayjs(b.displayTime).unix()
: dayjs(b.displayTime).unix() - dayjs(a.displayTime).unix(),
)
: dayjs(b.displayTime).unix() - dayjs(a.displayTime).unix();
})
}
orderBy={viewStore.state.orderByTimeAsc ? "display_time asc" : "display_time desc"}
/>

@ -60,11 +60,17 @@ const Home = observer(() => {
listSort={(memos: Memo[]) =>
memos
.filter((memo) => memo.state === State.NORMAL)
.sort((a, b) =>
viewStore.state.orderByTimeAsc
.sort((a, b) => {
if (a.pinned && !b.pinned) {
return -1;
}
if (!a.pinned && b.pinned) {
return 1;
}
return viewStore.state.orderByTimeAsc
? dayjs(a.displayTime).unix() - dayjs(b.displayTime).unix()
: dayjs(b.displayTime).unix() - dayjs(a.displayTime).unix(),
)
: dayjs(b.displayTime).unix() - dayjs(a.displayTime).unix();
})
}
orderBy={viewStore.state.orderByTimeAsc ? "display_time asc" : "display_time desc"}
filter={memoFilter}

@ -95,11 +95,17 @@ const UserProfile = observer(() => {
listSort={(memos: Memo[]) =>
memos
.filter((memo) => memo.state === State.NORMAL)
.sort((a, b) =>
viewStore.state.orderByTimeAsc
.sort((a, b) => {
if (a.pinned && !b.pinned) {
return -1;
}
if (!a.pinned && b.pinned) {
return 1;
}
return viewStore.state.orderByTimeAsc
? dayjs(a.displayTime).unix() - dayjs(b.displayTime).unix()
: dayjs(b.displayTime).unix() - dayjs(a.displayTime).unix(),
)
: dayjs(b.displayTime).unix() - dayjs(a.displayTime).unix();
})
}
orderBy={viewStore.state.orderByTimeAsc ? "display_time asc" : "display_time desc"}
filter={memoFilter}

@ -21,7 +21,15 @@ class LocalState {
}
get memos() {
return Object.values(this.memoMapByName);
return Object.values(this.memoMapByName).sort((a, b) => {
if (a.pinned && !b.pinned) {
return -1;
}
if (!a.pinned && b.pinned) {
return 1;
}
return 0;
});
}
get size() {

@ -13,11 +13,11 @@ if (process.env.DEV_PROXY_SERVER && process.env.DEV_PROXY_SERVER.length > 0) {
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react(),
tailwindcss(),
codeInspectorPlugin({
bundler: "vite",
}),
react(),
tailwindcss(),
],
server: {
host: "0.0.0.0",

Loading…
Cancel
Save