update glyph when history result exists

This commit is contained in:
Jeremy 2026-01-20 21:26:04 +11:00
parent e970bb4d4e
commit 90360022a4
2 changed files with 8 additions and 4 deletions

View file

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
@ -167,7 +167,7 @@ namespace Flow.Launcher.Plugin
/// <summary>
/// Information for Glyph Icon (Prioritized than IcoPath/Icon if user enable Glyph Icons)
/// </summary>
public GlyphInfo Glyph { get; init; }
public GlyphInfo Glyph { get; set; }
/// <summary>
/// An action to take in the form of a function call when the result has been selected.

View file

@ -4,6 +4,7 @@ using System.Linq;
using System.Text.Json.Serialization;
using Flow.Launcher.Core.Plugin;
using Flow.Launcher.Plugin;
using Svg;
namespace Flow.Launcher.Storage
{
@ -72,10 +73,13 @@ namespace Flow.Launcher.Storage
TryGetLastOpenedHistoryResult(result, out var existingHistoryItem))
{
existingHistoryItem.ExecutedDateTime = DateTime.Now;
if (existingHistoryItem.IcoPath != result.IcoPath)
{
existingHistoryItem.IcoPath = result.IcoPath;
}
if (existingHistoryItem.Glyph.Glyph != result.Glyph.Glyph
|| existingHistoryItem.Glyph.FontFamily != result.Glyph.FontFamily)
existingHistoryItem.Glyph = result.Glyph;
}
else
{