mirror of
https://github.com/open-webui/open-webui
synced 2025-03-15 18:12:19 +00:00
feat: haptic feedback on support devices (android)
Co-Authored-By: Danny Liu <dannyjialiliu@gmail.com>
This commit is contained in:
parent
04e2b6e2bd
commit
55097410f6
@ -877,6 +877,10 @@
|
|||||||
} else {
|
} else {
|
||||||
responseMessage.content += data.message.content;
|
responseMessage.content += data.message.content;
|
||||||
|
|
||||||
|
if (navigator.vibrate && ($settings?.hapticFeedback ?? false)) {
|
||||||
|
navigator.vibrate(5);
|
||||||
|
}
|
||||||
|
|
||||||
const sentences = extractSentencesForAudio(responseMessage.content);
|
const sentences = extractSentencesForAudio(responseMessage.content);
|
||||||
sentences.pop();
|
sentences.pop();
|
||||||
|
|
||||||
@ -1177,6 +1181,10 @@
|
|||||||
} else {
|
} else {
|
||||||
responseMessage.content += value;
|
responseMessage.content += value;
|
||||||
|
|
||||||
|
if (navigator.vibrate && ($settings?.hapticFeedback ?? false)) {
|
||||||
|
navigator.vibrate(5);
|
||||||
|
}
|
||||||
|
|
||||||
const sentences = extractSentencesForAudio(responseMessage.content);
|
const sentences = extractSentencesForAudio(responseMessage.content);
|
||||||
sentences.pop();
|
sentences.pop();
|
||||||
|
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
|
|
||||||
let showEmojiInCall = false;
|
let showEmojiInCall = false;
|
||||||
let voiceInterruption = false;
|
let voiceInterruption = false;
|
||||||
|
let hapticFeedback = false;
|
||||||
|
|
||||||
const toggleSplitLargeChunks = async () => {
|
const toggleSplitLargeChunks = async () => {
|
||||||
splitLargeChunks = !splitLargeChunks;
|
splitLargeChunks = !splitLargeChunks;
|
||||||
@ -70,6 +71,11 @@
|
|||||||
saveSettings({ voiceInterruption: voiceInterruption });
|
saveSettings({ voiceInterruption: voiceInterruption });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const toggleHapticFeedback = async () => {
|
||||||
|
hapticFeedback = !hapticFeedback;
|
||||||
|
saveSettings({ hapticFeedback: hapticFeedback });
|
||||||
|
};
|
||||||
|
|
||||||
const toggleUserLocation = async () => {
|
const toggleUserLocation = async () => {
|
||||||
userLocation = !userLocation;
|
userLocation = !userLocation;
|
||||||
|
|
||||||
@ -151,6 +157,8 @@
|
|||||||
chatDirection = $settings.chatDirection ?? 'LTR';
|
chatDirection = $settings.chatDirection ?? 'LTR';
|
||||||
userLocation = $settings.userLocation ?? false;
|
userLocation = $settings.userLocation ?? false;
|
||||||
|
|
||||||
|
hapticFeedback = $settings.hapticFeedback ?? false;
|
||||||
|
|
||||||
defaultModelId = $settings?.models?.at(0) ?? '';
|
defaultModelId = $settings?.models?.at(0) ?? '';
|
||||||
if ($config?.default_models) {
|
if ($config?.default_models) {
|
||||||
defaultModelId = $config.default_models.split(',')[0];
|
defaultModelId = $config.default_models.split(',')[0];
|
||||||
@ -438,6 +446,26 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<div class=" py-0.5 flex w-full justify-between">
|
||||||
|
<div class=" self-center text-xs">{$i18n.t('Haptic Feedback')}</div>
|
||||||
|
|
||||||
|
<button
|
||||||
|
class="p-1 px-3 text-xs flex rounded transition"
|
||||||
|
on:click={() => {
|
||||||
|
toggleHapticFeedback();
|
||||||
|
}}
|
||||||
|
type="button"
|
||||||
|
>
|
||||||
|
{#if hapticFeedback === true}
|
||||||
|
<span class="ml-2 self-center">{$i18n.t('On')}</span>
|
||||||
|
{:else}
|
||||||
|
<span class="ml-2 self-center">{$i18n.t('Off')}</span>
|
||||||
|
{/if}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class=" my-1.5 text-sm font-medium">{$i18n.t('Voice')}</div>
|
<div class=" my-1.5 text-sm font-medium">{$i18n.t('Voice')}</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
Loading…
Reference in New Issue
Block a user