1
0
mirror of https://github.com/koloml/furbooru-tagging-assistant.git synced 2025-12-23 23:02:58 +00:00

Warn user of potentially different/unknown site imports

This commit is contained in:
2025-08-08 20:41:55 +04:00
parent 8822a2581b
commit 0deafb4a00

View File

@@ -13,6 +13,7 @@
import ProfileView from "$components/features/ProfileView.svelte";
import GroupView from "$components/features/GroupView.svelte";
import { goto } from "$app/navigation";
import type { SameSiteStatus } from "$lib/extension/EntitiesTransporter";
let importedString = $state('');
let errorMessage = $state('');
@@ -50,6 +51,8 @@
const transporter = new BulkEntitiesTransporter();
let lastImportStatus = $state<SameSiteStatus>(null);
function tryBulkImport() {
importedProfiles = [];
importedGroups = [];
@@ -75,6 +78,8 @@
return;
}
lastImportStatus = transporter.lastImportSameSiteStatus;
if (importedEntities.length) {
for (const targetImportedEntity of importedEntities) {
switch (targetImportedEntity.type) {
@@ -180,7 +185,25 @@
{:else}
<Menu>
<MenuItem onclick={cancelImport} icon="arrow-left">Cancel Import</MenuItem>
<hr>
{#if lastImportStatus !== 'same'}
<hr>
{/if}
</Menu>
{#if lastImportStatus === "different"}
<p class="warning">
<b>Warning!</b>
Looks like these entities were exported for the different extension! There are many differences between tagging
systems of Furobooru and Derpibooru, so make sure to check if these settings are correct before using them!
</p>
{/if}
{#if lastImportStatus === 'unknown'}
<p class="warning">
<b>Warning!</b>
We couldn't verify if these settings are meant for this site or not. There are many differences between tagging
systems of Furbooru and Derpibooru, so make sure to check if these settings are correct before using them.
</p>
{/if}
<Menu>
{#if importedProfiles.length}
<hr>
<MenuCheckboxItem bind:checked={saveAllProfiles} oninput={createToggleAllOnUserInput('profiles')}>
@@ -234,7 +257,7 @@
<style lang="scss">
@use '$styles/colors';
.error {
.error, .warning {
padding: 5px 24px;
margin: {
left: -24px;
@@ -242,6 +265,10 @@
}
}
.warning {
background: colors.$warning-background;
}
.error {
background: colors.$error-background;
}