Skip to content

Commit

Permalink
ui fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mythz committed Oct 9, 2024
1 parent 36160ef commit f4428a3
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions AiServer/wwwroot/mjs/components/TextToImage.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,14 @@ export default {
storage.saveHistory(history.value)
}
function saveThread() {
console.log('saveThread', thread.value)
if (thread.value) {
storage.saveThread(thread.value)
}
}

async function send() {
savePrefs()
console.log('request', request.value)
console.debug(`${storage.prefix}.request`, request.value)

error.value = null
waitingOnResponse.value = true
Expand All @@ -185,7 +184,7 @@ export default {
/** @type {GenerationResponse} */
const r = api.response
if (r) {
console.log('response', r)
console.debug(`${storage.prefix}.response`, r)

if (!r.outputs?.length) {
error.value = createErrorStatus("no results were returned")
Expand Down Expand Up @@ -270,7 +269,6 @@ export default {
}

function toggleIcon(item) {
console.log('toggleIcon', item)
threadRef.value.icon = item.url
saveHistory()
}
Expand All @@ -283,10 +281,11 @@ export default {
const id = parseInt(routes.id)
thread.value = storage.getThread(storage.getThreadId(id))
threadRef.value = history.value.find(x => x.id === parseInt(routes.id))
Object.keys(storage.defaults).forEach(field =>
request.value[field] = thread.value[field] ?? storage.defaults[field])
Object.keys(storage.defaults).forEach(k =>
request.value[k] = thread.value[k] ?? storage.defaults[k])
} else {
thread.value = null
Object.keys(storage.defaults).forEach(k => request.value[k] = storage.defaults[k])
}
}

Expand Down Expand Up @@ -326,8 +325,9 @@ export default {
request.value.seed,
request.value.tag,
], () => {
Object.keys(storage.defaults).forEach(field =>
thread.value[field] = request.value[field] ?? storage.defaults[field])
if (!thread.value) return
Object.keys(storage.defaults).forEach(k =>
thread.value[k] = request.value[k] ?? storage.defaults[k])
saveThread()
})

Expand Down

0 comments on commit f4428a3

Please sign in to comment.