mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-06 17:11:55 +00:00
Fix Revolt on WebKit browsers.
This commit is contained in:
@@ -107,7 +107,7 @@ const Action = styled.div`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
// For sed replacement
|
// For sed replacement
|
||||||
const SED_REGEX = new RegExp("^s/([^])*/([^])*$");
|
const RE_SED = new RegExp("^s/([^])*/([^])*$");
|
||||||
|
|
||||||
// ! FIXME: add to app config and load from app config
|
// ! FIXME: add to app config and load from app config
|
||||||
export const CAN_UPLOAD_AT_ONCE = 4;
|
export const CAN_UPLOAD_AT_ONCE = 4;
|
||||||
@@ -206,7 +206,7 @@ export default observer(({ channel }: Props) => {
|
|||||||
// sed style message editing.
|
// sed style message editing.
|
||||||
// If the user types for example `s/abc/def`, the string "abc"
|
// If the user types for example `s/abc/def`, the string "abc"
|
||||||
// will be replaced with "def" in their last sent message.
|
// will be replaced with "def" in their last sent message.
|
||||||
if (SED_REGEX.test(content)) {
|
if (RE_SED.test(content)) {
|
||||||
renderer.messages.reverse();
|
renderer.messages.reverse();
|
||||||
const msg = renderer.messages.find(
|
const msg = renderer.messages.find(
|
||||||
(msg) => msg.author_id === client.user!._id,
|
(msg) => msg.author_id === client.user!._id,
|
||||||
@@ -215,7 +215,7 @@ export default observer(({ channel }: Props) => {
|
|||||||
|
|
||||||
if (msg) {
|
if (msg) {
|
||||||
// eslint-disable-next-line prefer-const
|
// eslint-disable-next-line prefer-const
|
||||||
let [_, toReplace, newText, flags] = content.split(/(?<!\\)\//);
|
let [_, toReplace, newText, flags] = content.split(/\//);
|
||||||
|
|
||||||
if (toReplace == "*") toReplace = msg.content.toString();
|
if (toReplace == "*") toReplace = msg.content.toString();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user