Verified Commit 99e863cb authored by WorldTeacher's avatar WorldTeacher
Browse files

fix(shelf-sync): check if dialog title can be set, fixing crash

parent 6e9fdb33
Loading
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -284,5 +284,6 @@ push-tag-to-github:
    - git config --global --add safe.directory "$CI_PROJECT_DIR"
  script:
    - echo "Pushing tag $CI_COMMIT_TAG to GitHub..."
    - git push "https://x-access-token:${GITHUB_TOKEN}@github.com/WorldTeacher/BookLoreSync-plugin.git" "$CI_COMMIT_TAG"
    - git remote add github "https://github.com/WorldTeacher/BookLoreSync-plugin.git"
    - git push github "$CI_COMMIT_TAG"
    - echo "Tag $CI_COMMIT_TAG pushed to GitHub successfully."
+21 −15
Original line number Diff line number Diff line
@@ -154,9 +154,16 @@ function M.new(deps)

        local self_for_callback = self
        if progress_widget then
            -- Update existing dialog's title
            progress_widget:setTitle(table.concat(lines, "\n"))
        else
            -- Update existing dialog's title if possible
            -- InfoMessage doesn't have setTitle — if that fails close it and
            -- fall through to create a ButtonDialog instead.
            local ok = pcall(progress_widget.setTitle, progress_widget, table.concat(lines, "\n"))
            if ok then
                return
            end
            pcall(UIManager.close, UIManager, progress_widget)
        end

        progress_widget = ButtonDialog:new{
            dismissable = false,
            title = table.concat(lines, "\n"),
@@ -170,7 +177,6 @@ function M.new(deps)
        }
        UIManager:show(progress_widget)
    end
    end

    local function closeProgress()
        if progress_widget then