~emerson/clarityirc

d3de86700e4b6f5d7b15d77d9687e464e8e9c856 — emerson 1 year, 4 months ago 8621fcf dev
fix ref stuff
2 files changed, 10 insertions(+), 11 deletions(-)

M src/irc/DisplayMessage.ts
M src/irc/IRCChannel.ts
M src/irc/DisplayMessage.ts => src/irc/DisplayMessage.ts +3 -3
@@ 1,9 1,9 @@
import { ref, type Ref } from "vue";
import { reactive } from "vue";
import type { IRCMessage } from "./IRCMessage";

export class DisplayMessage {
	public reactions: Ref<Map<string, number>>
	public reactions: Map<string, number>
	constructor(public time: Date, public sender: string, public msgType: string, public text: string, public originalMessage: IRCMessage) {
		this.reactions = ref(new Map<string, number>());
		this.reactions = reactive(new Map<string, number>());
	}
  }
\ No newline at end of file

M src/irc/IRCChannel.ts => src/irc/IRCChannel.ts +7 -8
@@ 1,20 1,19 @@
import { reactive, ref, type Ref } from "vue";
import { reactive } from "vue";
import { DisplayMessage } from "./DisplayMessage";
import { useMetadataStore } from "@/stores/metadata";

export class IRCChannel {
	public topic: Ref<string>
	public modes: Ref<Map<string, string>>
	public topic: string
	public modes: Map<string, string>
	public nicklist: Set<string>
	public messages: DisplayMessage[]
	public unreadMessages: Ref<number>
	public unreadMessages: number
	constructor(public name: string) {
		this.topic = ref("");
		this.modes = ref(new Map<string, string>());
		this.topic = "";
		this.modes = reactive(new Map<string, string>());
		this.nicklist = reactive(new Set<string>());
		this.messages = reactive([]);
		this.unreadMessages = ref(0);
		
		this.unreadMessages = 0;
	}

	addMessage(message: DisplayMessage) {