Jelajahi Sumber

remove startup chime

jelveh 2 hari lalu
induk
melakukan
39a59970bb

+ 0 - 20
src/gui/src/UI/Settings/UITabPersonalization.js

@@ -48,13 +48,6 @@ export default {
                     <option value="show">${i18n('clock_visible_show')}</option>
                 </select>
             </div>
-            <div class="settings-card">
-                <strong style="flex-grow:1;">Startup Sound</strong>
-                <label class="switch">
-                    <input type="checkbox" class="startup-chime-toggle">
-                    <span class="slider round"></span>
-                </label>
-            </div>
             <div class="settings-card" style="display: block; height: auto;">
                 <strong style="margin: 15px 0 30px; display: block;">${i18n('menubar_style')}</strong>
                 <div style="flex-grow:1; margin-top: 10px;">
@@ -109,19 +102,6 @@ export default {
 
         window.change_clock_visible();
 
-        // Initialize startup chime toggle
-        puter.kv.get('startup_chime_enabled').then(async (val) => {
-            // Default to enabled if not set
-            const enabled = val === 'false' ? false : true;
-            $el_window.find('.startup-chime-toggle').prop('checked', enabled);
-        });
-
-        // Handle startup chime toggle change
-        $el_window.find('.startup-chime-toggle').on('change', function(e) {
-            const enabled = $(this).is(':checked');
-            puter.kv.set('startup_chime_enabled', enabled.toString());
-        });
-
         puter.kv.get('menubar_style').then(async (val) => {
             if(val === 'system' || !val){
                 $el_window.find('#menubar_style_system').prop('checked', true);

+ 0 - 1
src/gui/src/UI/UIWindowLogin.js

@@ -28,7 +28,6 @@ import JustHTML from './Components/JustHTML.js';
 import StepView from './Components/StepView.js';
 import Button from './Components/Button.js';
 import RecoveryCodeEntryView from './Components/RecoveryCodeEntryView.js';
-import play_startup_chime from '../helpers/play_startup_chime.js';
 import CaptchaView from './Components/CaptchaView.js'
 import { isCaptchaRequired } from '../helpers/captchaHelper.js';
 

+ 0 - 6
src/gui/src/helpers.js

@@ -436,12 +436,6 @@ window.update_auth_data = async (auth_token, user)=>{
     window.auth_token = auth_token;
     localStorage.setItem('auth_token', auth_token);
 
-    // Play startup chime if enabled
-    if ( sessionStorage.getItem('playChimeNextUpdate') === 'yes' ) {
-        sessionStorage.setItem('playChimeNextUpdate', 'no');
-        // play_startup_chime();
-    }
-
     // Has username changed?
     if(window.user?.username !== user.username)
         update_username_in_gui(user.username);

+ 0 - 41
src/gui/src/helpers/play_startup_chime.js

@@ -1,41 +0,0 @@
-/**
- * Copyright (C) 2024-present Puter Technologies Inc.
- *
- * This file is part of Puter.
- *
- * Puter is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- * 
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- */
-
-/**
- * Plays the Puter startup chime sound if enabled in settings
- * @returns {Promise<void>} A promise that resolves when the sound has played or if playing is skipped
- */
-export default async function play_startup_chime() {
-    try {
-        // Check if startup chime is enabled in settings
-        const startupChimeEnabled = await puter.kv.get('startup_chime_enabled');
-        
-        // If explicitly disabled, don't play
-        if (startupChimeEnabled === 'false') {
-            return;
-        }
-        
-        // Create audio element and play the chime
-        const audio = new Audio('/audio/puter_chime.mp3');
-        await audio.play();
-    } catch (error) {
-        // Silently fail if audio can't be played (common in browsers without user interaction)
-        console.log('Could not play startup chime:', error);
-    }
-}