Fix message links from search.

This commit is contained in:
Paul
2021-07-31 22:39:15 +01:00
parent f20f1d8b41
commit 5c100b212e
5 changed files with 44 additions and 3 deletions

View File

@@ -298,10 +298,10 @@ function Search({ channel }: { channel: Channel }) {
{results.map((message) => {
let href = "";
if (channel?.channel_type === "TextChannel") {
href += `/server/${channel.server}`;
href += `/server/${channel.server_id}`;
}
href += `/channel/${message.channel}/${message._id}`;
href += `/channel/${message.channel_id}/${message._id}`;
return (
<Link to={href}>

18
src/globals.d.ts vendored Normal file
View File

@@ -0,0 +1,18 @@
type Build = "stable" | "nightly" | "dev";
type NativeConfig = {
frame: boolean;
build: Build;
};
declare interface Window {
isNative?: boolean;
native: {
close();
reload();
getConfig(): NativeConfig;
setFrame(frame: boolean);
setBuild(build: Build);
};
}

View File

@@ -3,6 +3,7 @@ import {
Sync as SyncIcon,
Globe,
LogOut,
Desktop,
} from "@styled-icons/boxicons-regular";
import {
Bell,
@@ -38,6 +39,7 @@ import { Appearance } from "./panes/Appearance";
import { ExperimentsPage } from "./panes/Experiments";
import { Feedback } from "./panes/Feedback";
import { Languages } from "./panes/Languages";
import { Native } from "./panes/Native";
import { Notifications } from "./panes/Notifications";
import { Profile } from "./panes/Profile";
import { Sessions } from "./panes/Sessions";
@@ -100,6 +102,11 @@ export default function Settings() {
icon: <SyncIcon size={20} />,
title: <Text id="app.settings.pages.sync.title" />,
},
{
id: "native",
icon: <Desktop size={20} />,
title: <Text id="app.settings.pages.native.title" />,
},
{
divider: true,
id: "experiments",
@@ -133,6 +140,11 @@ export default function Settings() {
<Route path="/settings/sync">
<Sync />
</Route>,
window.isNative && (
<Route path="/settings/native">
<Native />
</Route>
),
<Route path="/settings/experiments">
<ExperimentsPage />
</Route>,

View File

@@ -0,0 +1,11 @@
import { SyncOptions } from "../../../redux/reducers/sync";
import Checkbox from "../../../components/ui/Checkbox";
interface Props {
options?: SyncOptions;
}
export function Native(props: Props) {
return <div></div>;
}