diff --git a/lua/lualine/components/gh-actions.lua b/lua/lualine/components/gh-actions.lua index b02b8a8..5ec19e0 100644 --- a/lua/lualine/components/gh-actions.lua +++ b/lua/lualine/components/gh-actions.lua @@ -1,11 +1,3 @@ -local function store() - return require('gh-actions.store') -end - -local function icons() - return require('gh-actions.utils.icons') -end - local function gh() return require('gh-actions.github') end @@ -23,6 +15,8 @@ function component:init(options) component.super.init(self, options) self.options = vim.tbl_deep_extend('force', default_options, options or {}) + self.store = require('gh-actions.store') + self.icons = require('gh-actions.utils.icons') local server, repo = gh().get_current_repository() @@ -32,14 +26,14 @@ function component:init(options) require('gh-actions').start_polling() - store().on_update(function() + self.store.on_update(function() require('lualine').refresh() end) end ---@override function component:update_status() - local state = store().get_state() + local state = self.store.get_state() local latest_workflow_run = state.workflow_runs and state.workflow_runs[1] or {} @@ -48,7 +42,7 @@ function component:update_status() return '' end - return icons().get_workflow_run_icon(latest_workflow_run) + return self.icons.get_workflow_run_icon(latest_workflow_run) .. ' ' .. latest_workflow_run.name end