Skip to content

Commit

Permalink
Fix e.getTime
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolfkid200444 committed Mar 3, 2024
1 parent 56e01f3 commit a04cec3
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,8 @@
"prettier": "^2.8.8",
"replugged": "^4.7.5",
"typescript": "^4.9.5"
},
"dependencies": {
"react": "^18.2.0"
}
}
14 changes: 12 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/components/modals/Notebook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const renderNotebook = ({
if (sortType)
messageArray.sort(
(a, b) =>
new Date(b.props.note.timestamp).getTime() - new Date(a.props.note.timestamp).getTime(),
new Date(b.props.note?.timestamp)?.getTime() - new Date(a.props.note?.timestamp)?.getTime(),
);

if (sortDirection) messageArray.reverse();
Expand Down
8 changes: 4 additions & 4 deletions src/components/modals/RenderMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ const { message, groupStart, cozyMessage } = await webpack.waitForModule<{
cozyMessage: string;
}>(webpack.filters.byProps("cozyMessage"));

const Moment = (await webpack.waitForModule(
webpack.filters.bySource("parseTwoDigitYear"),
)) as unknown as Discord.MomentConstructor;
// const Moment = (await webpack.waitForModule(
// webpack.filters.bySource("parseTwoDigitYear"),
// )) as unknown as Discord.MomentConstructor;

const User = webpack.getBySource("isClyde(){") as unknown as Discord.UserConstructor;
const Message = webpack.getBySource("isEdited(){") as unknown as Discord.MessageConstructor;
Expand Down Expand Up @@ -108,7 +108,7 @@ export default ({
{ ...note },
{
author: new User({ ...note.author }),
timestamp: new Moment(new Date(note.timestamp)),
timestamp: new Date(note.timestamp),
embeds: note.embeds.map((embed: { timestamp: string | number | Date }) =>
embed.timestamp
? Object.assign(embed, {
Expand Down

0 comments on commit a04cec3

Please sign in to comment.