mirror of
				https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
				synced 2025-11-04 16:23:41 +08:00 
			
		
		
		
	Merge pull request #618 from ilario92/main
Update: Confirmation on reset chats and settings
This commit is contained in:
		
							
								
								
									
										2
									
								
								.github/workflows/sync.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/sync.yml
									
									
									
									
										vendored
									
									
								
							@@ -5,7 +5,7 @@ permissions:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
on:
 | 
					on:
 | 
				
			||||||
  schedule:
 | 
					  schedule:
 | 
				
			||||||
    - cron: "0 */6 * * *" # every 6 hours
 | 
					    - cron: "0 * * * *" # every hour
 | 
				
			||||||
  workflow_dispatch:
 | 
					  workflow_dispatch:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
jobs:
 | 
					jobs:
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -156,7 +156,14 @@ export function Settings(props: { closeSettings: () => void }) {
 | 
				
			|||||||
          <div className={styles["window-action-button"]}>
 | 
					          <div className={styles["window-action-button"]}>
 | 
				
			||||||
            <IconButton
 | 
					            <IconButton
 | 
				
			||||||
              icon={<ClearIcon />}
 | 
					              icon={<ClearIcon />}
 | 
				
			||||||
              onClick={clearSessions}
 | 
					              onClick={() => {
 | 
				
			||||||
 | 
					                const confirmed = window.confirm(
 | 
				
			||||||
 | 
					                  `${Locale.Settings.Actions.ConfirmClearAll.Confirm}`,
 | 
				
			||||||
 | 
					                );
 | 
				
			||||||
 | 
					                if (confirmed) {
 | 
				
			||||||
 | 
					                  clearSessions();
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					              }}
 | 
				
			||||||
              bordered
 | 
					              bordered
 | 
				
			||||||
              title={Locale.Settings.Actions.ClearAll}
 | 
					              title={Locale.Settings.Actions.ClearAll}
 | 
				
			||||||
            />
 | 
					            />
 | 
				
			||||||
@@ -164,7 +171,14 @@ export function Settings(props: { closeSettings: () => void }) {
 | 
				
			|||||||
          <div className={styles["window-action-button"]}>
 | 
					          <div className={styles["window-action-button"]}>
 | 
				
			||||||
            <IconButton
 | 
					            <IconButton
 | 
				
			||||||
              icon={<ResetIcon />}
 | 
					              icon={<ResetIcon />}
 | 
				
			||||||
              onClick={resetConfig}
 | 
					              onClick={() => {
 | 
				
			||||||
 | 
					                const confirmed = window.confirm(
 | 
				
			||||||
 | 
					                  `${Locale.Settings.Actions.ConfirmResetAll.Confirm}`,
 | 
				
			||||||
 | 
					                );
 | 
				
			||||||
 | 
					                if (confirmed) {
 | 
				
			||||||
 | 
					                  resetConfig();
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					              }}
 | 
				
			||||||
              bordered
 | 
					              bordered
 | 
				
			||||||
              title={Locale.Settings.Actions.ResetAll}
 | 
					              title={Locale.Settings.Actions.ResetAll}
 | 
				
			||||||
            />
 | 
					            />
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -57,6 +57,12 @@ const cn = {
 | 
				
			|||||||
      ClearAll: "清除所有数据",
 | 
					      ClearAll: "清除所有数据",
 | 
				
			||||||
      ResetAll: "重置所有选项",
 | 
					      ResetAll: "重置所有选项",
 | 
				
			||||||
      Close: "关闭",
 | 
					      Close: "关闭",
 | 
				
			||||||
 | 
					      ConfirmResetAll: {
 | 
				
			||||||
 | 
					        Confirm: "Are you sure you want to reset all configurations?",
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      ConfirmClearAll: {
 | 
				
			||||||
 | 
					        Confirm: "Are you sure you want to reset all chat?",
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    Lang: {
 | 
					    Lang: {
 | 
				
			||||||
      Name: "Language",
 | 
					      Name: "Language",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -60,6 +60,12 @@ const en: LocaleType = {
 | 
				
			|||||||
      ClearAll: "Clear All Data",
 | 
					      ClearAll: "Clear All Data",
 | 
				
			||||||
      ResetAll: "Reset All Settings",
 | 
					      ResetAll: "Reset All Settings",
 | 
				
			||||||
      Close: "Close",
 | 
					      Close: "Close",
 | 
				
			||||||
 | 
					      ConfirmResetAll: {
 | 
				
			||||||
 | 
					        Confirm: "Are you sure you want to reset all configurations?",
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      ConfirmClearAll: {
 | 
				
			||||||
 | 
					        Confirm: "Are you sure you want to reset all chat?",
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    Lang: {
 | 
					    Lang: {
 | 
				
			||||||
      Name: "Language", // ATTENTION: if you wanna add a new translation, please do not translate this value, leave it as `Language`
 | 
					      Name: "Language", // ATTENTION: if you wanna add a new translation, please do not translate this value, leave it as `Language`
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -60,6 +60,12 @@ const es: LocaleType = {
 | 
				
			|||||||
      ClearAll: "Borrar todos los datos",
 | 
					      ClearAll: "Borrar todos los datos",
 | 
				
			||||||
      ResetAll: "Restablecer todas las configuraciones",
 | 
					      ResetAll: "Restablecer todas las configuraciones",
 | 
				
			||||||
      Close: "Cerrar",
 | 
					      Close: "Cerrar",
 | 
				
			||||||
 | 
					      ConfirmResetAll: {
 | 
				
			||||||
 | 
					        Confirm: "Are you sure you want to reset all configurations?",
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      ConfirmClearAll: {
 | 
				
			||||||
 | 
					        Confirm: "Are you sure you want to reset all chat?",
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    Lang: {
 | 
					    Lang: {
 | 
				
			||||||
      Name: "Language",
 | 
					      Name: "Language",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -60,6 +60,12 @@ const it: LocaleType = {
 | 
				
			|||||||
      ClearAll: "Cancella tutti i dati",
 | 
					      ClearAll: "Cancella tutti i dati",
 | 
				
			||||||
      ResetAll: "Resetta tutte le impostazioni",
 | 
					      ResetAll: "Resetta tutte le impostazioni",
 | 
				
			||||||
      Close: "Chiudi",
 | 
					      Close: "Chiudi",
 | 
				
			||||||
 | 
					      ConfirmResetAll: {
 | 
				
			||||||
 | 
					        Confirm: "Sei sicuro vuoi cancellare tutte le impostazioni?",
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      ConfirmClearAll: {
 | 
				
			||||||
 | 
					        Confirm: "Sei sicuro vuoi cancellare tutte le chat?",
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    Lang: {
 | 
					    Lang: {
 | 
				
			||||||
      Name: "Lingue",
 | 
					      Name: "Lingue",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -58,6 +58,12 @@ const tw: LocaleType = {
 | 
				
			|||||||
      ClearAll: "清除所有數據",
 | 
					      ClearAll: "清除所有數據",
 | 
				
			||||||
      ResetAll: "重置所有設定",
 | 
					      ResetAll: "重置所有設定",
 | 
				
			||||||
      Close: "關閉",
 | 
					      Close: "關閉",
 | 
				
			||||||
 | 
					      ConfirmResetAll: {
 | 
				
			||||||
 | 
					        Confirm: "Are you sure you want to reset all configurations?",
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      ConfirmClearAll: {
 | 
				
			||||||
 | 
					        Confirm: "Are you sure you want to reset all chat?",
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    Lang: {
 | 
					    Lang: {
 | 
				
			||||||
      Name: "Language",
 | 
					      Name: "Language",
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user