mirror of
				https://github.com/notion-enhancer/notion-enhancer.git
				synced 2025-10-31 06:08:09 +11:00 
			
		
		
		
	chore: disable telemetry, remove sponsor perks (temp)
This commit is contained in:
		
							parent
							
								
									c8613d0937
								
							
						
					
					
						commit
						9b36ca26b2
					
				| @ -4,8 +4,10 @@ | ||||
|  * (https://notion-enhancer.github.io/) under the MIT license
 | ||||
|  */ | ||||
| 
 | ||||
| // telemetry endpoint not ready, disabled for current release
 | ||||
| 
 | ||||
| import { checkForUpdate } from "./updateCheck.mjs"; | ||||
| import { sendTelemetryPing } from "./sendTelemetry.mjs"; | ||||
| // import { sendTelemetryPing } from "./sendTelemetry.mjs";
 | ||||
| import { Modal, Frame } from "./islands/Modal.mjs"; | ||||
| import { MenuButton } from "./islands/MenuButton.mjs"; | ||||
| import { Tooltip } from "./islands/Tooltip.mjs"; | ||||
| @ -152,5 +154,5 @@ export default async (api, db) => | ||||
|     insertPanel(api, db), | ||||
|     insertCustomStyles(api, db), | ||||
|     loadThemeOverrides(api, db), | ||||
|     sendTelemetryPing(), | ||||
|     // sendTelemetryPing(),
 | ||||
|   ]).then(() => api.sendMessage("notion-enhancer", "load-complete")); | ||||
|  | ||||
| @ -166,14 +166,13 @@ function Banner({ updateAvailable, isDevelopmentBuild }) { | ||||
|           >Sponsor me | ||||
|         <//>
 | ||||
|       </div> | ||||
|       <!-- Disclaimer: these perks are only a draft, for anyone reading this. | ||||
|       This information may change at any time. --> | ||||
|       <!-- Disclaimer: draft of potential perks, to be confirmed before full release. --> | ||||
|       <${Description} class="mt-[6px]"> | ||||
|         Sponsors help make open-source development sustainable and receive | ||||
|         <!-- Sponsors help make open-source development sustainable and receive | ||||
|         access to priority support channels, private developer previews, and | ||||
|         role cosmetics on Discord. A one-time donation is equivalent to 1 month | ||||
|         of sponsor perks. To learn more about perks, read the | ||||
|         <a href=${tsAndCs} class="ml-[3px]">Terms & Conditions</a>. | ||||
|         <a href=${tsAndCs} class="ml-[3px]">Terms & Conditions</a>. --> | ||||
|       <//>
 | ||||
|     </div>`; | ||||
|   initDatabase() | ||||
|  | ||||
| @ -31,9 +31,7 @@ function Onboarding() { | ||||
|         process and/or store data on your device (including workspace content, | ||||
|         device metadata, and notion-enhancer configuration) as described in its | ||||
|         privacy policy. Unless otherwise stated, the notion-enhancer will never | ||||
|         transmit your information from your device. Collection of anonymous | ||||
|         telemetry data is enabled by default and can be disabled at any time | ||||
|         through the menu. | ||||
|         transmit personally identifiable information from your device. | ||||
|         <br /><br /> | ||||
|         The notion-enhancer is free and open-source software distributed under | ||||
|         the <a href="${tsAndCs}#license">MIT License</a> without warranty of any | ||||
|  | ||||
| @ -4,6 +4,8 @@ | ||||
|  * (https://notion-enhancer.github.io/) under the MIT license
 | ||||
|  */ | ||||
| 
 | ||||
| // telemetry endpoint not ready, disabled for current release
 | ||||
| 
 | ||||
| import { collectTelemetryData } from "../../sendTelemetry.mjs"; | ||||
| import { Option } from "./Options.mjs"; | ||||
| 
 | ||||
|  | ||||
| @ -9,7 +9,6 @@ import { Sidebar } from "./islands/Sidebar.mjs"; | ||||
| import { Footer } from "./islands/Footer.mjs"; | ||||
| import { Banner } from "./islands/Banner.mjs"; | ||||
| import { Onboarding } from "./islands/Onboarding.mjs"; | ||||
| import { Telemetry } from "./islands/Telemetry.mjs"; | ||||
| import { View } from "./islands/View.mjs"; | ||||
| import { List } from "./islands/List.mjs"; | ||||
| import { Mod } from "./islands/Mod.mjs"; | ||||
| @ -140,17 +139,16 @@ const renderMenu = async () => { | ||||
|               <//>
 | ||||
|               <${View} id="core"> | ||||
|                 <${Options} mod=${mods.find(({ _src }) => _src === "core")} /> | ||||
|                 <${Telemetry} /> | ||||
|                 <${Profiles} /> | ||||
|               <//>
 | ||||
|               ${[...categories, ...mods] | ||||
|                 <//>
 | ||||
|                 ${[...categories, ...mods] | ||||
|                 .filter(({ view }) => view) | ||||
|                 .map(({ view }) => view)} | ||||
|             </div> | ||||
|           </div> | ||||
|           <${Footer} categories=${categories} /> | ||||
|         </main> | ||||
|       `;
 | ||||
|         `;
 | ||||
|     useState(["footerOpen"], ([footerOpen]) => { | ||||
|       $main.style.height = footerOpen ? "100%" : "calc(100% + 65px)"; | ||||
|     }); | ||||
|  | ||||
| @ -4,6 +4,8 @@ | ||||
|  * (https://notion-enhancer.github.io/) under the MIT license
 | ||||
|  */ | ||||
| 
 | ||||
| // telemetry endpoint not ready, disabled for current release
 | ||||
| 
 | ||||
| const pingEndpoint = "https://notion-enhancer.deno.dev/api/ping", | ||||
|   collectTelemetryData = async () => { | ||||
|     const { platform, version } = globalThis.__enhancerApi, | ||||
| @ -17,29 +19,29 @@ const pingEndpoint = "https://notion-enhancer.deno.dev/api/ping", | ||||
|     return { platform, version, timezone, enabled_mods }; | ||||
|   }, | ||||
|   sendTelemetryPing = async () => { | ||||
|     const db = __enhancerApi.initDatabase(), | ||||
|       { version } = globalThis.__enhancerApi, | ||||
|       agreedToTerms = await db.get("agreedToTerms"), | ||||
|       telemetryEnabled = (await db.get("telemetryEnabled")) ?? true; | ||||
|     if (!telemetryEnabled || agreedToTerms !== version) return; | ||||
|     // const db = __enhancerApi.initDatabase(),
 | ||||
|     //   { version } = globalThis.__enhancerApi,
 | ||||
|     //   agreedToTerms = await db.get("agreedToTerms"),
 | ||||
|     //   telemetryEnabled = (await db.get("telemetryEnabled")) ?? true;
 | ||||
|     // if (!telemetryEnabled || agreedToTerms !== version) return;
 | ||||
| 
 | ||||
|     const lastTelemetryPing = await db.get("lastTelemetryPing"); | ||||
|     if (lastTelemetryPing) { | ||||
|       const msSincePing = Date.now() - new Date(lastTelemetryPing); | ||||
|       // send ping only once a week
 | ||||
|       if (msSincePing / 8.64e7 < 7) return; | ||||
|     } | ||||
|     // const lastTelemetryPing = await db.get("lastTelemetryPing");
 | ||||
|     // if (lastTelemetryPing) {
 | ||||
|     //   const msSincePing = Date.now() - new Date(lastTelemetryPing);
 | ||||
|     //   // send ping only once a week
 | ||||
|     //   if (msSincePing / 8.64e7 < 7) return;
 | ||||
|     // }
 | ||||
| 
 | ||||
|     try { | ||||
|       const telemetryData = await collectTelemetryData(), | ||||
|         pingTimestamp = await fetch(pingEndpoint, { | ||||
|           method: "POST", | ||||
|           body: JSON.stringify(telemetryData), | ||||
|         }).then((res) => res.text()); | ||||
|       await db.set("lastTelemetryPing", pingTimestamp); | ||||
|     } catch (err) { | ||||
|       console.error(err); | ||||
|     } | ||||
|     // try {
 | ||||
|     //   const telemetryData = await collectTelemetryData(),
 | ||||
|     //     pingTimestamp = await fetch(pingEndpoint, {
 | ||||
|     //       method: "POST",
 | ||||
|     //       body: JSON.stringify(telemetryData),
 | ||||
|     //     }).then((res) => res.text());
 | ||||
|     //   await db.set("lastTelemetryPing", pingTimestamp);
 | ||||
|     // } catch (err) {
 | ||||
|     //   console.error(err);
 | ||||
|     // }
 | ||||
|   }; | ||||
| 
 | ||||
| export { collectTelemetryData, sendTelemetryPing }; | ||||
|  | ||||
| @ -20,7 +20,6 @@ | ||||
|     "tabs", | ||||
|     "storage", | ||||
|     "userScripts", | ||||
|     "clipboardRead", | ||||
|     "clipboardWrite", | ||||
|     "unlimitedStorage" | ||||
|   ], | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user