mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-26 09:00:57 -05:00
Fix Revolt on WebKit browsers.
This commit is contained in:
parent
8ca83ad95d
commit
8ba5c13cfc
1 changed files with 3 additions and 3 deletions
|
@ -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();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue