How to use the quasar-framework/dist/quasar.mat.esm.Notify.create function in quasar-framework

To help you get started, we’ve selected a few quasar-framework examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Rebolon / php-sf-flex-webpack-encore-vuejs / assets / js / lib / login.js View on Github external
export const logout = function() {
    resetLoginInfo()
    Notify.create({
        message: 'You have been logged out.',
        type: 'info'
    })

    // @todo check if current route is !== from login then go to login else do nothing
    console.info('compare the location.href with / if different then push / to router, check that you dont loop infinitly')
    if (location.hash.replace('#/', '/') !== '/') {
        router.push('/')
    }
}
github Rebolon / php-sf-flex-webpack-encore-vuejs / assets / js / login / components / Secured.vue View on Github external
created() {
        const defaultUser = {
            user: {
                username: 'inconnu'
            }
        }

        this.user = defaultUser

        if (typeof localStorage == 'undefined') {
            Notify.create({
                message: `No localStorage feature available in the browser`,
                type: 'warning'
            })
        }

        IsLoggedInObservable.subscribe(isLoggedIn => {
            if (!isLoggedIn
                || !isLoggedIn.me) {
                this.user = defaultUser
            } else {
                this.user = isLoggedIn.me
            }
            this.isLoading = false
        }, err => {
            // @todo we may have different message belongs to err
            Notify.create({
github Rebolon / php-sf-flex-webpack-encore-vuejs / assets / js / lib / axiosMiddlewares.js View on Github external
.then(res => {
                Notify.create({
                    message: `Invalid token, please try again`,
                    type: 'warning'
                })
            })
            .catch(err => console.warn('axios middleware CsrfTokenRetreiveOnInvalidResponse', 'getToken', err))
github Rebolon / php-sf-flex-webpack-encore-vuejs / assets / js / lib / apollo.js View on Github external
onError(({ networkError }) => {
    if (423 === networkError.statusCode) {
        getToken()
            .then(res => Toast.create.warning(`Invalid token, please try again`))
            .catch(err => console.warn('apollo onError', 'getToken', err))
    } else {
        console.warn(`Unknown error ${networkError.statusCode}`, networkError)
        Notify.create({
            message: `Unknown error ${networkError.statusCode}`,
            type: 'warning'
        })
    }
})