Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add brave skill issue modal #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions src/components/installer/BraveModal.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!--
Vencord WebInstaller, a web frontend for the Vencord Installer
Copyright (c) 2023 Vendicated, Justice Almanzar and Vencord contributors
SPDX-License-Identifier: GPL-3.0-or-later
-->

<script lang="ts">
import LinkButton from "../LinkButton.svelte";
import Heading from "../text/Heading.svelte";
</script>

<section role="dialog">
<Heading tag="h6" --color="var(--accent-red)">It seems you are using Brave</Heading>
<p>Brave users need to disable Brave Shields, because it blocks the connection to the installer helper.</p>
<br />
<LinkButton
href="https://support.brave.com/hc/en-us/articles/360022806212-How-do-I-use-Shields-while-using-the-Tor-network-"
target="_blank"
rel="noopener noreferrer">How to disable Brave Shields</LinkButton
>
</section>

<style>
section {
padding: 2em;
text-align: center;
}
</style>
21 changes: 21 additions & 0 deletions src/components/installer/Installer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,30 @@

<script lang="ts">
import { readyStore } from "../../webSocket";
import { openWindow } from "../../windows";
import Heading from "../text/Heading.svelte";
import BraveModal from "./BraveModal.svelte";
import Main from "./Main.svelte";
import NoConnection from "./NoConnection.svelte";

$: ready = $readyStore;

function onLoad() {
// @ts-ignore - brave is not defined in types
if (navigator?.brave !== undefined) {
// brave shields are enabled
openWindow(
BraveModal,
{},
{
title: "Brave skill issue",
width: 400,
height: 215,
maximizable: false
}
);
}
}
</script>

<main>
Expand All @@ -23,6 +42,8 @@
{/if}
</main>

<svelte:window on:load={onLoad} />

<style>
main {
display: flex;
Expand Down