Fix message links from search.

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

2
external/lang vendored

@ -1 +1 @@
Subproject commit 0f98b07eb411ec5a9207536f6adc5aa8055e755e Subproject commit e03c9f3a9ef39b6d93a5890a3ee1a64cfb1ffec4

View file

@ -298,10 +298,10 @@ function Search({ channel }: { channel: Channel }) {
{results.map((message) => { {results.map((message) => {
let href = ""; let href = "";
if (channel?.channel_type === "TextChannel") { 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 ( return (
<Link to={href}> <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, Sync as SyncIcon,
Globe, Globe,
LogOut, LogOut,
Desktop,
} from "@styled-icons/boxicons-regular"; } from "@styled-icons/boxicons-regular";
import { import {
Bell, Bell,
@ -38,6 +39,7 @@ import { Appearance } from "./panes/Appearance";
import { ExperimentsPage } from "./panes/Experiments"; import { ExperimentsPage } from "./panes/Experiments";
import { Feedback } from "./panes/Feedback"; import { Feedback } from "./panes/Feedback";
import { Languages } from "./panes/Languages"; import { Languages } from "./panes/Languages";
import { Native } from "./panes/Native";
import { Notifications } from "./panes/Notifications"; import { Notifications } from "./panes/Notifications";
import { Profile } from "./panes/Profile"; import { Profile } from "./panes/Profile";
import { Sessions } from "./panes/Sessions"; import { Sessions } from "./panes/Sessions";
@ -100,6 +102,11 @@ export default function Settings() {
icon: <SyncIcon size={20} />, icon: <SyncIcon size={20} />,
title: <Text id="app.settings.pages.sync.title" />, title: <Text id="app.settings.pages.sync.title" />,
}, },
{
id: "native",
icon: <Desktop size={20} />,
title: <Text id="app.settings.pages.native.title" />,
},
{ {
divider: true, divider: true,
id: "experiments", id: "experiments",
@ -133,6 +140,11 @@ export default function Settings() {
<Route path="/settings/sync"> <Route path="/settings/sync">
<Sync /> <Sync />
</Route>, </Route>,
window.isNative && (
<Route path="/settings/native">
<Native />
</Route>
),
<Route path="/settings/experiments"> <Route path="/settings/experiments">
<ExperimentsPage /> <ExperimentsPage />
</Route>, </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>;
}