Passed
Push — 6.4 ( 232ba6...48563d )
by Christian
18:34 queued 27s
created

index.js ➔ updateUserActivity   A

Complexity

Conditions 3

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 2
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
import template from './sw-admin.html.twig';
2
3
const { Component } = Shopware;
0 ignored issues
show
Bug introduced by
The variable Shopware seems to be never declared. If this is a global, consider adding a /** global: Shopware */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
4
5
/**
6
 * @package admin
7
 *
8
 * @private
9
 */
10
Component.register('sw-admin', {
11
    template,
12
13
    inject: ['userActivityService'],
14
15
    metaInfo() {
16
        return {
17
            title: this.$tc('global.sw-admin-menu.textShopwareAdmin'),
18
        };
19
    },
20
21
    computed: {
22
        isLoggedIn() {
23
            return Shopware.Service('loginService').isLoggedIn();
0 ignored issues
show
Bug introduced by
The variable Shopware seems to be never declared. If this is a global, consider adding a /** global: Shopware */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
24
        },
25
    },
26
27
    methods: {
28
        onUserActivity: Shopware.Utils.debounce(function updateUserActivity() {
29
            this.userActivityService.updateLastUserActivity();
30
        }, 5000),
31
    },
32
});
33