Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
withinJoel committed May 27, 2024
1 parent 5e7493e commit e68382d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Script/Packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,9 +393,12 @@ function openTXT(data) {

//Open Image
async function openImage(data) {
const existingElement = document.querySelector('video[data-role="dynamic-video"]') || document.querySelector('[data-role="dynamic-dragged"]');
const existingImgElement = document.querySelector('video[data-role="dynamic-video"]') || document.querySelector('[data-role="dynamic-image"]') || document.querySelector('[data-role="dynamic-dragged"]');
const existingErrorElement = document.querySelector('div[data-role="error-message"]');

if (existingElement) {
existingElement.remove();
}
// Remove existing error message if any
if (existingErrorElement) {
document.body.removeChild(existingErrorElement);
Expand Down Expand Up @@ -437,9 +440,12 @@ async function openImage(data) {

//Open Video
async function openVideo(data) {
const existingElement = document.querySelector('[data-role="dynamic-image"]') || document.querySelector('[data-role="dynamic-dragged"]');
const existingVidElement = document.querySelector('video[data-role="dynamic-video"]') || document.querySelector('[data-role="dynamic-image"]') || document.querySelector('[data-role="dynamic-dragged"]');
const existingErrorElement = document.querySelector('div[data-role="error-message"]');

if (existingElement) {
existingElement.remove();
}
// Remove existing error message if any
if (existingErrorElement) {
document.body.removeChild(existingErrorElement);
Expand Down

0 comments on commit e68382d

Please sign in to comment.