Skip to content

c-app-update-alert

A component that displays a notification when a new version of the application has been deployed, prompting the user to refresh the page.

This component monitors the X-App-Build response header on API responses (emitted by app.UseAppVersionHeader() on the server). When the header value changes from the initially observed value, a v-snackbar is displayed with a refresh button.

Examples

Place in your root App.vue, inside the <v-app> element:

template
<v-app>
  ...
  <CAppUpdateAlert />
</v-app>

Props

axiosInstance?: AxiosInstance

The Axios instance to monitor for version changes. Defaults to the Coalesce AxiosClient.

Slots

#default

Override the default message text ("A new version of this application is available.").

#actions

Override the action buttons. Receives a reload function as a slot prop that triggers window.location.reload().

template
<CAppUpdateAlert>
  <template #actions="{ reload }">
    <v-btn @click="reload">Update Now</v-btn>
  </template>
</CAppUpdateAlert>

Server Setup

The server must emit an X-App-Build response header for this component to function. Add the following to your ASP.NET Core middleware pipeline:

c#
app.UseAppVersionHeader();

See UseAppVersionHeader for details.


Coalesce is a free and open-source framework created by IntelliTect to fill our desire to create better apps, faster. IntelliTect is a high-end software architecture and development consulting firm based in Spokane, Washington.

If you're looking for help with your software project, whether it be a Coalesce application, other technologies, or even just an idea, reach out to us at info@intellitect.com — we'd love to start a conversation! Our clients range from Fortune 100 companies to local small businesses and non-profits.