Skip to content

Commit 1642ff7

Browse files
authored
ENG-862: Check if user has two sidebar's installed (#528)
* Check if left sidebar script is loaded in graph * address coderabbit review
1 parent cbf7e08 commit 1642ff7

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

apps/roam/src/index.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,20 @@ export default runExtension(async (onloadArgs) => {
146146

147147
installDiscourseFloatingMenu(onloadArgs);
148148

149+
const leftSidebarScript = document.querySelector<HTMLScriptElement>(
150+
'script#roam-left-sidebar[src="https://sid597.github.io/roam-left-sidebar/js/main.js"]',
151+
);
152+
153+
if (leftSidebarScript) {
154+
renderToast({
155+
id: "discourse-graph-left-sidebar-conflict",
156+
intent: "warning",
157+
timeout: 10000,
158+
content:
159+
"Discourse Graph detected the Roam left sidebar script. Running both sidebars may cause issues. Please remove the Roam left sidebar script from your Roam instance, and reload the graph.",
160+
});
161+
}
162+
149163
return {
150164
elements: [
151165
style,

0 commit comments

Comments
 (0)