Giter VIP home page Giter VIP logo

chiragchrg / arms-v3 Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 1.84 MB

ARMS is an educational platform designed to empower students with easy access to study materials for their respective subjects. Students can conveniently browse and download PDF documents uploaded by authorized faculties.

Home Page: https://arms-v3.vercel.app/

License: MIT License

JavaScript 0.25% CSS 1.67% TypeScript 98.07% HTML 0.02%
chiragchrg edgestore mongodb mongoose nextauthjs nextjs reactjs shadcn-ui tailwindcss tanstack-query typescript zustand

arms-v3's Introduction


LinkedIn Facebook Twitter Google ChiragChrg|Portfolio

Statistics

Top Langs

Statscard

GitHub Streak

WakaTime stats

Languages & Tools

Front-End()

Back-End()

Programming()

Tech & Tools()

Contribution Snake :

github contribution grid snake animation

arms-v3's People

Contributors

chiragchrg avatar

Stargazers

 avatar

Watchers

 avatar

arms-v3's Issues

ERROR: (using Next.js, TanstackQuery, Axios) Server returns Old data, even after deleting content from the database. Fresh data is only fetched after rebuilding vercel deployment.

The code seems to work correctly in local development server, but after deploying on vercel it appears that the data is cached and the same data is returned on every request. Even after deleting/adding some data to mongodb the data does not update.
I have tried disabling all caching methods on fetching, added queryCache.clear() from TanstackQuery and disabled 'Vercel Data Cache', it did not resolve the issue.
The fresh data is fetched only after redeplying the site on vercel.

"beforeinstallprompt" Event Listener not triggered on page load. Next.js 14, Next-PWA

Im trying to manually trigger PWA install prompt using my UI.
The PWA id called from root page.tsx & Sidebar component.
HandlePWAInstall function is triggered from this page

pwa.ts

interface DeferredPrompt {
    prompt: () => void;
    userChoice: Promise<{ outcome: string }>;
}

let deferredPrompt: DeferredPrompt | null = null;

// Show PWA install alert triggered by user button click
export const HandlePWAInstall = async () => {
    console.log("deferredPWAPrompt", deferredPrompt);

    if (deferredPrompt) {
        deferredPrompt.prompt();
        const { outcome } = await deferredPrompt.userChoice;
        console.log(outcome);
        deferredPrompt = null;
    } else {
        alert("Prompt Failed");
    }
};

const PWA = () => {
    console.log("PWA Triggered")
    window.addEventListener("beforeinstallprompt", (e) => {
        console.log("PWA Event", e)
        e.preventDefault();
        deferredPrompt = e as unknown as DeferredPrompt;
    });

    window.addEventListener("appinstalled", () => {
        deferredPrompt = null;
        console.log("PWA was installed");
    });
};

export default PWA;

I have used a similar method on another project and it works correctly. (prompt is triggered using button on Toast notification)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.