forked from open-webui/open-webui
		
	fix: loop until voice list available
This commit is contained in:
		
							parent
							
								
									9101c174d8
								
							
						
					
					
						commit
						3b7f7c6e32
					
				
					 1 changed files with 11 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -618,7 +618,17 @@
 | 
			
		|||
		gravatarEmail = settings.gravatarEmail ?? '';
 | 
			
		||||
 | 
			
		||||
		speakVoice = settings.speakVoice ?? '';
 | 
			
		||||
		await voices.set(await speechSynthesis.getVoices());
 | 
			
		||||
		// await voices.set(await speechSynthesis.getVoices());
 | 
			
		||||
 | 
			
		||||
		const getVoicesLoop = setInterval(async () => {
 | 
			
		||||
			const _voices = await speechSynthesis.getVoices();
 | 
			
		||||
			await voices.set(_voices);
 | 
			
		||||
 | 
			
		||||
			// do your loop
 | 
			
		||||
			if (_voices.length > 0) {
 | 
			
		||||
				clearInterval(getVoicesLoop);
 | 
			
		||||
			}
 | 
			
		||||
		}, 100);
 | 
			
		||||
 | 
			
		||||
		saveChatHistory = settings.saveChatHistory ?? true;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue