Skip to content
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

chore(dependency): update wasm to 1.5.1 #814

Merged
merged 4 commits into from
Nov 5, 2024
Merged
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@
"trystero": "^0.20.0",
"uuid": "^9.0.1",
"vite-plugin-node-polyfills": "^0.21.0",
"warp-wasm": "1.3.5"
"warp-wasm": "1.5.1"
}
}
22 changes: 15 additions & 7 deletions src/lib/wasm/RaygunStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class RaygunStore {
await r.create_group_conversation(
name,
recipients.map(r => r.key),
new wasm.GroupSettings()
new wasm.GroupPermissions()
),
r
),
Expand Down Expand Up @@ -159,7 +159,15 @@ class RaygunStore {
}

async updateConversationSettings(conversation_id: string, settings: ConversationSettings) {
return await this.get(r => r.update_conversation_settings(conversation_id, settings), "Error updating conversation settings")
return await this.get(async r => {
let conv = await r.get_conversation(conversation_id)
// TODO. this needs ui revamp as its now user based and not global
r.update_conversation_permissions(conversation_id, conv.permissions())
}, "Error updating conversation settings")
}

async updateConversationDescription(conversation_id: string, description: string) {
return await this.get(r => r.set_conversation_description(conversation_id, description), "Error updating conversation settings")
}

/**
Expand All @@ -177,7 +185,7 @@ class RaygunStore {
let convs = await r.list_conversations()
convs
.convs()
.filter(c => parseJSValue(c.settings()).type === "direct" && recipient in c.recipients())
.filter(c => c.conversation_type() === wasm.ConversationType.Direct && recipient in c.recipients())
.forEach(async conv => {
await this.get(r => r.delete(conv.id(), undefined), "Error deleting message")
})
Expand Down Expand Up @@ -800,8 +808,7 @@ class RaygunStore {
* Converts warp message to ui message
*/
private async convertWarpConversation(chat: wasm.Conversation, raygun: wasm.RayGunBox): Promise<Chat> {
let setting = parseJSValue(chat.settings())
let direct = setting.type === "direct"
let direct = chat.conversation_type() === wasm.ConversationType.Direct
let msg = await this.getMessages(raygun, chat.id(), new MessageOptions())
chat.recipients().forEach(async recipient => {
let user = await MultipassStoreInstance.identity_from_did(recipient)
Expand All @@ -817,10 +824,11 @@ class RaygunStore {
settings: {
displayOwnerBadge: true,
readReceipts: true,
// TODO. this needs ui revamp as its now user based and not global
permissions: {
allowAnyoneToAddUsers: !direct && (setting.values["members_can_add_participants"] as boolean),
allowAnyoneToAddUsers: !direct && true,
allowAnyoneToModifyPhoto: false,
allowAnyoneToModifyName: !direct && (setting.values["members_can_change_name"] as boolean),
allowAnyoneToModifyName: !direct && true,
},
},
creator: chat.creator(),
Expand Down
2 changes: 1 addition & 1 deletion src/lib/wasm/TesseractStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class TesseractStore {
removeSeed() {
const tesseract = get(this.tesseractWritable)
if (!tesseract?.exist("mnemonic")) return
tesseract?._delete("mnemonic")
tesseract?.delete("mnemonic")
}

async initTesseract(from?: wasm.Tesseract) {
Expand Down