Attempt to fix img is null

This commit is contained in:
cyi1341 2024-02-11 22:36:54 +08:00
parent d616e1049e
commit 45735523c3
1 changed files with 4 additions and 9 deletions

View File

@ -13,13 +13,8 @@
let isSubmitted = true;
// Function to reload the page
function reloadPage() {
window.location.reload();
}
// Reload the page every 20 minutes (1200000 milliseconds)
setInterval(reloadPage, 1200000);
setInterval(window.location.reload(), 1200000);
while (true) {
if (isSubmitted) {
console.log("%cNew Wayspot", "font-weight: bold;");
@ -35,7 +30,7 @@
for (let retries = 0; retries < MAX_RETRIES; retries++) {
try {
// Your existing code starts here
let url = 'https://generativelanguage.googleapis.com/v1beta/models/gemini-pro-vision:generateContent?key=MY_GEMINI_KEY'
let url = 'https://generativelanguage.googleapis.com/v1beta/models/gemini-pro-vision:generateContent?key=AIzaSyB7-gSfD9pZKyTAIT7L-OVp7TPtwWKgMxU'
var inlineData = [];
for (let i = 0; i < base64data.length; i++) {
inlineData.push({
@ -613,8 +608,8 @@
// Select the img element inside the div
var img = document.querySelector('.wf-image-modal.flex-grow.bg-contain.bg-center.bg-no-repeat img');
if (img == null) {
reloadPage()
if (img === null) {
window.location.reload()
}
// Get the src attribute of the img element