Skip to content

handle reactivity on our own #352

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
[submodule "packages/revolt.js"]
path = packages/revolt.js
url = https://github.com/revoltchat/revolt.js
[submodule "components/i18n/locales"]
path = packages/client/components/i18n/locales
url = https://github.com/revoltchat/translations
path = packages/client/components/i18n/locales
url = https://github.com/revoltchat/translations
[submodule "packages/client/assets"]
path = packages/client/assets
url = https://github.com/revoltchat/assets
update = none
path = packages/client/assets
url = https://github.com/revoltchat/assets
update = none
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ type CategoryData = Omit<API.Category, "channels"> & { channels: Channel[] };
/**
* Display server information and channels
*/
// TODO: fix reactivity here on channel add/edit/delete
export const ServerSidebar = (props: Props) => {
const navigate = useNavigate();
const keybinds = useKeybindActions();
Expand Down
2 changes: 1 addition & 1 deletion packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,4 @@
"zod": "3.23.8"
},
"private": true
}
}
1 change: 1 addition & 0 deletions packages/client/src/interface/Friends.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ type FriendLists = Accessor<{
/**
* Friends menu
*/
// TODO: fix reactivity
export function Friends() {
const client = useClient();

Expand Down
1 change: 1 addition & 0 deletions packages/client/src/interface/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ export function HomePage() {

return (
// TODO: i18n
// TODO: reactivity
<Base>
<Header placement="primary">
<HeaderIcon>
Expand Down
2 changes: 2 additions & 0 deletions packages/client/src/interface/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import { Route, useParams, useSmartParams } from "@revolt/routing";
import { state } from "@revolt/state";
import { HomeSidebar, ServerList, ServerSidebar } from "@revolt/ui";

// TODO: fix reactivity

/**
* Left-most channel navigation sidebar
*/
Expand Down
11 changes: 7 additions & 4 deletions packages/client/src/interface/channels/text/Composition.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
} from "solid-icons/bi";
import { For, Match, Show, Switch, onCleanup, onMount } from "solid-js";

import { API, Channel } from "revolt.js";
import { Channel } from "revolt.js";

import { useClient } from "@revolt/client";
import { debounce } from "@revolt/common";
Expand All @@ -23,7 +23,10 @@ import {
MessageBox,
MessageReplyPreview,
} from "@revolt/ui";
import { registerKeybindWithPriority, unregisterKeybindWithPriority } from "../../../shared/lib/priorityKeybind";
import {
registerKeybindWithPriority,
unregisterKeybindWithPriority,
} from "../../../shared/lib/priorityKeybind";

interface Props {
/**
Expand Down Expand Up @@ -74,7 +77,7 @@ export function MessageComposition(props: Props) {
if (typeof isTyping === "number" && +new Date() < isTyping) return;

const ws = client()!.events;
if (ws.state() === 2) {
if (ws.state === 2) {
isTyping = +new Date() + 2500;
ws.send({
type: "BeginTyping",
Expand All @@ -89,7 +92,7 @@ export function MessageComposition(props: Props) {
function stopTyping() {
if (isTyping) {
const ws = client()!.events;
if (ws.state() === 2) {
if (ws.state === 2) {
isTyping = undefined;
ws.send({
type: "EndTyping",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { For, Match, Show, Switch, createMemo, onMount } from "solid-js";
import { Match, Show, Switch, createMemo, onMount } from "solid-js";

import { VirtualContainer } from "@minht11/solid-virtual-container";
import { Channel, ServerMember, User } from "revolt.js";
Expand Down Expand Up @@ -51,6 +51,8 @@ export function MemberSidebar(props: Props) {
*/
const IGNORE_ALL = ["01F7ZSBSFHQ8TA81725KQCSDDP", "01F80118K1F2EYD9XAMCPQ0BCT"];

// TODO: fix reactivity with revolt.js changes

/**
* Server Member Sidebar
*/
Expand Down
2 changes: 2 additions & 0 deletions packages/client/src/interface/channels/text/TextChannel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ export function TextChannel(props: ChannelPageProps) {
)
);

// TODO: fix message unread floater, typing indicator, editing messages, member sidebar

return (
<>
<Header placement="primary">
Expand Down
1 change: 0 additions & 1 deletion packages/revolt.js
Submodule revolt.js deleted from 26fabc
Loading