Skip to content

Commit

Permalink
Resolved translation copy issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ezfe committed Nov 2, 2020
1 parent c00c302 commit bd8bf8c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/helpers/copy_snippet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Snippet } from "../classes/Snippets/SnippetTypes/Snippet";
import { TextSnippet } from "../classes/Snippets/SnippetTypes/TextSnippet";
import { PagebreakSnippet } from "../classes/Snippets/SnippetTypes/PagebreakSnippet";
import { NBTSnippet } from "../classes/Snippets/SnippetTypes/NBTSnippet";
import { TranslateSnippet } from "../classes/Snippets/SnippetTypes/TranslateSnippet";

export function duplicate_snippet(snippet: Snippet) {
if (snippet instanceof LinebreakSnippet) {
Expand All @@ -22,9 +23,10 @@ export function duplicate_snippet(snippet: Snippet) {
return snippet.copy()
} else if (snippet instanceof NBTSnippet) {
return snippet.copy()
} else if (snippet instanceof TranslateSnippet) {
return snippet.copy()
} else {
alert("An unknown issue occurred\n\nMore information is provided in the browser console")
console.error("An error occurred copying a snippet. It probably hasn't been implemented yet in the copy_snippet function.", snippet)
alert("An error occurred copying a snippet. It probably hasn't been implemented yet in the copy_snippet function.")

let x = new TextSnippet(null)
x.text = "A copy error occurred"
Expand Down

0 comments on commit bd8bf8c

Please sign in to comment.