Skip to content

Commit

Permalink
1.94.1 (#358)
Browse files Browse the repository at this point in the history
# PR Checklist
- [ ] Did you check if it works normally in all models? *ignore this
when it dosen't uses models*
- [ ] Did you check if it works normally in all of web, local and node
hosted versions? if it dosen't, did you blocked it in those versions?
- [ ] Did you added a type def?

# Description
  • Loading branch information
kwaroran authored Apr 10, 2024
2 parents bee236e + d1ace0c commit c0578fc
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"package": {
"productName": "RisuAI",
"version": "1.94.0"
"version": "1.94.1"
},
"tauri": {
"allowlist": {
Expand Down
4 changes: 2 additions & 2 deletions src/lib/ChatScreens/BackgroundDom.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { ParseMarkdown, risuChatParser } from "src/ts/parser";
import { DataBase, type Database, type character, type groupChat } from "src/ts/storage/database";
import { selectedCharID } from "src/ts/stores";
import { CurrentVariablePointer, selectedCharID } from "src/ts/stores";
import { onDestroy } from "svelte";
let backgroundHTML = ''
Expand Down Expand Up @@ -42,7 +42,7 @@


{#if backgroundHTML}
{#key currentChar}
{#key $CurrentVariablePointer}
<div class="absolute top-0 left-0 w-full h-full">
{#await ParseMarkdown(risuChatParser(backgroundHTML, {chara:currentChar}), currentChar, 'back') then md}
{@html md}
Expand Down
8 changes: 4 additions & 4 deletions src/lib/ChatScreens/Chat.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
import { alertConfirm, alertError, alertRequestData } from "../../ts/alert";
import { language } from "../../lang";
import { DataBase, type MessageGenerationInfo } from "../../ts/storage/database";
import { CurrentCharacter, CurrentChat } from "../../ts/stores";
import { CurrentCharacter, CurrentChat, CurrentVariablePointer } from "../../ts/stores";
import { translateHTML } from "../../ts/translator/translator";
import { risuChatParser } from "src/ts/process/scripts";
import { get } from "svelte/store";
import { capitalize, isEqual } from "lodash";
import { sayTTS } from "src/ts/process/tts";
import { getModelShortName } from "src/ts/model/names";
import { getModelShortName } from "src/ts/model/names";
export let message = ''
export let name = ''
export let largePortrait = false
Expand Down Expand Up @@ -68,7 +68,7 @@
$CurrentChat.message = msg
}
function displaya(message:string){
function displaya(message:string, chatPointer?:any){
msgDisplay = risuChatParser(message, {chara: name, chatID: idx, rmVar: true, visualize: true})
}
Expand Down Expand Up @@ -124,7 +124,7 @@
}
}
$: displaya(message)
$: displaya(message, $CurrentVariablePointer)
</script>
<div class="flex max-w-full justify-center risu-chat" style={isLastMemory ? `border-top:${$DataBase.memoryLimitThickness}px solid rgba(98, 114, 164, 0.7);` : ''}>
<div class="text-textcolor mt-1 ml-4 mr-4 mb-1 p-2 bg-transparent flex-grow border-t-gray-900 border-opacity-30 border-transparent flexium items-start max-w-full" >
Expand Down
2 changes: 1 addition & 1 deletion src/ts/storage/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type { OobaChatCompletionRequestParams } from '../model/ooba';

export const DataBase = writable({} as any as Database)
export const loadedStore = writable(false)
export let appVer = "1.94.0"
export let appVer = "1.94.1"
export let webAppSubVer = ''

export function setDatabase(data:Database){
Expand Down
17 changes: 13 additions & 4 deletions src/ts/stores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export const CurrentUserIcon = writable(db.userIcon)
export const CurrentShowMemoryLimit = writable(db.showMemoryLimit)
export const ShowVN = writable(false)
export const SettingsMenuIndex = writable(-1)
export const CurrentVariablePointer = writable({} as {[key:string]: string|number|boolean})

function createSimpleCharacter(char:character|groupChat){
if((!char) || char.type === 'group'){
Expand Down Expand Up @@ -136,12 +137,20 @@ CurrentCharacter.subscribe((char) => {

CurrentChat.subscribe((chat) => {
let currentChar = get(CurrentCharacter)

if(currentChar){
if(isEqual(currentChar.chats[currentChar.chatPage], chat)){
return
if(!isEqual(currentChar.chats[currentChar.chatPage], chat)){
currentChar.chats[currentChar.chatPage] = cloneDeep(chat)
CurrentCharacter.set(currentChar)
}
currentChar.chats[currentChar.chatPage] = cloneDeep(chat)
CurrentCharacter.set(currentChar)
}

const variablePointer = get(CurrentVariablePointer)
const currentState = structuredClone(chat?.scriptstate)

if(!isEqual(variablePointer, currentState)){
CurrentVariablePointer.set(currentState)
console.log(currentState)
}
})

Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"1.94.0"}
{"version":"1.94.1"}

0 comments on commit c0578fc

Please sign in to comment.