Fully renamed socket to ttp
This commit is contained in:
parent
7ebe028629
commit
76ca664298
13 changed files with 55 additions and 42 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import type { BoundSendFn } from "@tensamin/ttp/core";
|
||||
import type { Socket } from "@tensamin/shared/data";
|
||||
import type { TTP } from "@tensamin/shared/data";
|
||||
import type { RawMessages } from "../values";
|
||||
|
||||
/**
|
||||
|
|
@ -11,7 +11,7 @@ import type { RawMessages } from "../values";
|
|||
* @returns Promise<RawMessages>.
|
||||
*/
|
||||
export async function getMessages(
|
||||
send: BoundSendFn<Socket>,
|
||||
send: BoundSendFn<TTP>,
|
||||
amount: number,
|
||||
offset: number,
|
||||
user_id: number,
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { Button } from "@tensamin/ui/cmp/button";
|
|||
|
||||
import { Plus, Laugh, Clapperboard } from "lucide-react";
|
||||
import { useChat } from "../context";
|
||||
import { useSocket } from "@tensamin/ttp/context";
|
||||
import { useTTP } from "@tensamin/ttp/context";
|
||||
import { useCrypto } from "@tensamin/crypto/context";
|
||||
import { log, toast } from "@tensamin/shared/log";
|
||||
|
||||
|
|
@ -15,7 +15,7 @@ export default function InputComponent() {
|
|||
const [invertEnterBehavior, setInvertEnterBehavior] = React.useState(false);
|
||||
|
||||
const { encrypt } = useCrypto();
|
||||
const { send } = useSocket();
|
||||
const { send } = useTTP();
|
||||
const { addLiveMessage, sharedSecret, userId } = useChat();
|
||||
const { load } = useStorage();
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import type { LiveMessage, RawMessage, RawMessages } from "./values";
|
|||
import { useCrypto } from "@tensamin/crypto/context";
|
||||
import { useUser } from "@tensamin/user/context";
|
||||
import { useStorage } from "@tensamin/storage/context";
|
||||
import { useSocket } from "@tensamin/ttp/context";
|
||||
import { useTTP } from "@tensamin/ttp/context";
|
||||
|
||||
export const context = createContext<contextType | undefined>(undefined);
|
||||
|
||||
|
|
@ -29,7 +29,7 @@ export default function Provider(props: { children: ReactNode }) {
|
|||
const { getSharedSecret } = useCrypto();
|
||||
const { get } = useUser();
|
||||
const { load } = useStorage();
|
||||
const { send, subscribePush } = useSocket();
|
||||
const { send, subscribePush } = useTTP();
|
||||
|
||||
const [liveMessagesState, setLiveMessagesState] = useState<LiveMessage[]>([]);
|
||||
const [currentSharedSecret, setCurrentSharedSecret] = useState("");
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { z } from "zod";
|
||||
import { socket } from "@tensamin/shared/data";
|
||||
import { ttp } from "@tensamin/shared/data";
|
||||
|
||||
export type RawMessages = z.infer<
|
||||
typeof socket.messages_get.response
|
||||
typeof ttp.messages_get.response
|
||||
>["messages"];
|
||||
|
||||
export type RawMessage = RawMessages[number];
|
||||
|
|
|
|||
Loading…
Reference in a new issue