MCPcopy Create free account
hub / github.com/SKVNDR/FastDork / handleResetAllData

Function handleResetAllData

Script/FastDork.js:1901–1943  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1899 }
1900
1901 async function handleResetAllData() {
1902 const messageText = `Are you sure you want to reset ALL data (lists, settings, custom site configs) to defaults? This cannot be undone.`;
1903 setupConfirmationModal(
1904 messageText,
1905 async () => {
1906 hideModal();
1907 try {
1908 console.log("Starting data reset...");
1909 const response = await chrome.runtime.sendMessage({
1910 action: "resetDefaultLists",
1911 });
1912 if (response?.success) {
1913 console.log("Background script confirmed successful reset.");
1914 } else {
1915 throw new Error(
1916 response?.error || "Background script failed to reset data."
1917 );
1918 }
1919 console.log("Reset successful, refreshing UI...");
1920 await loadAndPopulateLists();
1921 resetDorkListSelections();
1922 await removeStorageData(CONSTANTS.STORAGE_KEYS.SIDE_PANEL_ENABLED);
1923 await setSidePanelActionBehavior(false);
1924 setSidePanelToggleState(false);
1925 if (UI.targetTab1) UI.targetTab1.value = "";
1926 if (UI.selectModTab1) UI.selectModTab1.value = "0";
1927 await populateSearchEngineDropdown();
1928 if (UI.siteSettingsContainer?.style.display === "block") {
1929 await loadAndDisplayUserSiteSelectors();
1930 }
1931 showModal("Reset complete! Default lists and settings restored.");
1932 console.log("UI refreshed after reset.");
1933 } catch (error) {
1934 console.error("Error during reset:", error);
1935 showModal(`Error performing reset: ${error.message}`);
1936 }
1937 },
1938 () => {
1939 console.log("Reset cancelled by user.");
1940 hideModal();
1941 }
1942 );
1943 }
1944 async function loadSiteConfigs() {
1945 try {
1946 const data = await getStorageData([

Callers

nothing calls this directly

Calls 10

setupConfirmationModalFunction · 0.85
hideModalFunction · 0.85
loadAndPopulateListsFunction · 0.85
resetDorkListSelectionsFunction · 0.85
setSidePanelToggleStateFunction · 0.85
showModalFunction · 0.85
removeStorageDataFunction · 0.70

Tested by

no test coverage detected