2.0.2 • Published 6 months ago

check-appn-version v2.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

Reload Dialog Module

This module renders a dialog to reload the application if there is a version update.

Props

Prop NameTypeDefault ValueDescription
labelstring''Custom label for the dialog
onClickfuncnullCallback function triggered on button click
btnNamestring'Reload'Text displayed on the reload button
currentVersionstring''Current version of the application
fileNamestring''Name of the file to check for version updates
dialogInactivityTimeoutnumber180000 (3 mins)Timeout for dialog inactivity
defaultAutoRefreshTimenumber600000 (10 mins)Frequency of version check API calls

How It Works

  1. The module makes an API call to domain/${fileName} every defaultAutoRefreshTime milliseconds.
  2. Ensure this route exists in your backend app and returns an object in the format (application/json):
    { "version": "x.y" }
  3. The module compares the received version with the currentVersion prop.
  4. If there is a mismatch, a dialog appears prompting the user to reload the page.

Usage

<ReloadDialog 
    currentVersion="1.0.0" 
    fileName="version.json" 
    btnName="Update Now" 
    dialogInactivityTimeout={180000} 
    defaultAutoRefreshTime={600000} 
/>

Ensure your backend serves the version information at domain/version.json to support this functionality.

2.0.2

6 months ago

2.0.1

6 months ago

2.0.0

6 months ago

1.0.7

11 months ago

1.0.6

11 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago

0.1.0

11 months ago