forked from abner/for-legacy-web
Fix server id not being replaced properly.
Fix links in spoilers opening when revealing. Fix unread icon appearing for home. Fix unreads not being acknowledged.
This commit is contained in:
2
external/lang
vendored
2
external/lang
vendored
Submodule external/lang updated: f3c9912420...eb880a9025
@@ -97,7 +97,7 @@
|
|||||||
"react-router-dom": "^5.2.0",
|
"react-router-dom": "^5.2.0",
|
||||||
"react-scroll": "^1.8.2",
|
"react-scroll": "^1.8.2",
|
||||||
"redux": "^4.1.0",
|
"redux": "^4.1.0",
|
||||||
"revolt.js": "5.0.0-alpha.10",
|
"revolt.js": "5.0.0-alpha.11",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"sass": "^1.35.1",
|
"sass": "^1.35.1",
|
||||||
"shade-blend-color": "^1.0.0",
|
"shade-blend-color": "^1.0.0",
|
||||||
|
|||||||
@@ -118,6 +118,7 @@
|
|||||||
|
|
||||||
> * {
|
> * {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:global(.shown) {
|
&:global(.shown) {
|
||||||
@@ -128,6 +129,7 @@
|
|||||||
|
|
||||||
> * {
|
> * {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
|
pointer-events: unset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,9 +92,8 @@ export default function Renderer({ content, disallowBigEmoji }: MarkdownProps) {
|
|||||||
|
|
||||||
// We replace the message with the mention at the time of render.
|
// We replace the message with the mention at the time of render.
|
||||||
// We don't care if the mention changes.
|
// We don't care if the mention changes.
|
||||||
const newContent = content.replace(
|
const newContent = content
|
||||||
RE_MENTIONS,
|
.replace(RE_MENTIONS, (sub: string, ...args: any[]) => {
|
||||||
(sub: string, ...args: any[]) => {
|
|
||||||
const id = args[0],
|
const id = args[0],
|
||||||
user = client.users.get(id);
|
user = client.users.get(id);
|
||||||
|
|
||||||
@@ -103,20 +102,17 @@ export default function Renderer({ content, disallowBigEmoji }: MarkdownProps) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return sub;
|
return sub;
|
||||||
},
|
})
|
||||||
).replace(
|
.replace(RE_CHANNELS, (sub: string, ...args: any[]) => {
|
||||||
RE_CHANNELS,
|
|
||||||
(sub: string, ...args: any[]) => {
|
|
||||||
const id = args[0],
|
const id = args[0],
|
||||||
channel = client.channels.get(id);
|
channel = client.channels.get(id);
|
||||||
|
|
||||||
if (channel?.channel_type === 'TextChannel') {
|
if (channel?.channel_type === "TextChannel") {
|
||||||
return `[#${channel.name}](/server/${channel.server}/channel/${id})`;
|
return `[#${channel.name}](/server/${channel.server_id}/channel/${id})`;
|
||||||
}
|
}
|
||||||
|
|
||||||
return sub;
|
return sub;
|
||||||
},
|
});
|
||||||
);
|
|
||||||
|
|
||||||
const useLargeEmojis = disallowBigEmoji
|
const useLargeEmojis = disallowBigEmoji
|
||||||
? false
|
? false
|
||||||
|
|||||||
@@ -218,7 +218,7 @@ export const ServerListSidebar = observer(({ unreads, lastOpened }: Props) => {
|
|||||||
if (
|
if (
|
||||||
(x.channel?.channel_type === "DirectMessage"
|
(x.channel?.channel_type === "DirectMessage"
|
||||||
? x.channel?.active
|
? x.channel?.active
|
||||||
: true) &&
|
: x.channel?.channel_type === "Group") &&
|
||||||
x.unread
|
x.unread
|
||||||
) {
|
) {
|
||||||
homeUnread = "unread";
|
homeUnread = "unread";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { autorun } from "mobx";
|
import { autorun, isObservableProp, reaction } from "mobx";
|
||||||
import { Channel } from "revolt.js/dist/maps/Channels";
|
import { Channel } from "revolt.js/dist/maps/Channels";
|
||||||
|
|
||||||
import { useLayoutEffect } from "preact/hooks";
|
import { useLayoutEffect } from "preact/hooks";
|
||||||
@@ -17,10 +17,7 @@ export function useUnreads({ channel, unreads }: UnreadProps) {
|
|||||||
const client = useClient();
|
const client = useClient();
|
||||||
|
|
||||||
useLayoutEffect(() => {
|
useLayoutEffect(() => {
|
||||||
function checkUnread(
|
function checkUnread(target: Channel) {
|
||||||
target: Channel,
|
|
||||||
last_message: Channel["last_message"],
|
|
||||||
) {
|
|
||||||
if (!target) return;
|
if (!target) return;
|
||||||
if (target._id !== channel._id) return;
|
if (target._id !== channel._id) return;
|
||||||
if (
|
if (
|
||||||
@@ -50,7 +47,11 @@ export function useUnreads({ channel, unreads }: UnreadProps) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return autorun(() => checkUnread(channel!, channel!.last_message));
|
checkUnread(channel);
|
||||||
|
return reaction(
|
||||||
|
() => channel.last_message,
|
||||||
|
() => checkUnread(channel),
|
||||||
|
);
|
||||||
}, [channel, unreads]);
|
}, [channel, unreads]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3570,10 +3570,10 @@ revolt-api@0.5.1-alpha.10-patch.0:
|
|||||||
resolved "https://registry.yarnpkg.com/revolt-api/-/revolt-api-0.5.1-alpha.10-patch.0.tgz#97d31bec7dfa4573567097443acb059c4feaac20"
|
resolved "https://registry.yarnpkg.com/revolt-api/-/revolt-api-0.5.1-alpha.10-patch.0.tgz#97d31bec7dfa4573567097443acb059c4feaac20"
|
||||||
integrity sha512-UyM890HkGlYNQOxpHuEpUsJHLt8Ujnjg9/zPEDGpbvS4iy0jmHX23Hh8tOCfb/ewxbNrtT3G1HpSWKOneW/vYg==
|
integrity sha512-UyM890HkGlYNQOxpHuEpUsJHLt8Ujnjg9/zPEDGpbvS4iy0jmHX23Hh8tOCfb/ewxbNrtT3G1HpSWKOneW/vYg==
|
||||||
|
|
||||||
revolt.js@5.0.0-alpha.10:
|
revolt.js@5.0.0-alpha.11:
|
||||||
version "5.0.0-alpha.10"
|
version "5.0.0-alpha.11"
|
||||||
resolved "https://registry.yarnpkg.com/revolt.js/-/revolt.js-5.0.0-alpha.10.tgz#3fa1a8944a338134da09626278ee47b91f20ce2a"
|
resolved "https://registry.yarnpkg.com/revolt.js/-/revolt.js-5.0.0-alpha.11.tgz#af131150ce37a39b979501c730ec2bee5a4e38a1"
|
||||||
integrity sha512-b5nCQDtLUei4mfXhZNkIfQiyG8WDHBnpOVRaRaJz2ZjcQtdBjxIPXxOWkBYL7N/dBJ7sn5xgLMqra9UzkwkewA==
|
integrity sha512-aOD8IV2DM9Ebq15FVQ2GJDGBaICppk+jP06dW0KlrDeVoE3Hra5CRLHSIRtp2mJN/vh1cH+9eA78jssAlAgwAw==
|
||||||
dependencies:
|
dependencies:
|
||||||
axios "^0.19.2"
|
axios "^0.19.2"
|
||||||
eventemitter3 "^4.0.7"
|
eventemitter3 "^4.0.7"
|
||||||
|
|||||||
Reference in New Issue
Block a user