Skip to content

Commit

Permalink
Twitter list bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Meisterlala committed Dec 30, 2022
1 parent ecf1c86 commit a1a9fa5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
5 changes: 4 additions & 1 deletion Neko/Gui/ImageSourcesWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,10 @@ private void DrawTwitter()
ImGui.SameLine(ImGui.GetWindowContentRegionMax().X - ImGui.GetWindowContentRegionMin().X - length);
if (ImGui.Button("Remove##Twitter") && selectedTwitterEntry >= 0)
{
Plugin.Config.Sources.Twitter.queries.RemoveAll(q => q == TwitterTableEntries[selectedTwitterEntry].Query);
if (!Plugin.Config.Sources.Twitter.queries.Remove(TwitterTableEntries[selectedTwitterEntry].Query))
{
PluginLog.LogError("Failed to remove Twitter query: " + TwitterTableEntries[selectedTwitterEntry].Query.searchText);
}
TwitterTableEntries.RemoveAt(selectedTwitterEntry);
if (TwitterTableEntries.Count == 0)
{
Expand Down
2 changes: 1 addition & 1 deletion Neko/Neko.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Version>1.2.1</Version>
<Version>1.2.2</Version>
<TargetFramework>net6.0-windows</TargetFramework>
<LangVersion>latest</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand Down
2 changes: 1 addition & 1 deletion Neko/Neko.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Punchline": "Frustrated in a dungeon? Look at a cute cat girl!",
"Description": "Shows you an image of a random neko character. Click on the image to view the next one.\nYou can choose different image sources, allowing you to look at Catboys, Waifus, Cats, Dogs and more.\n\nSupported APIs:\nTwitter, nekos.best, Nekos.life, Catboys, Dog CEO, The Cat API, Pic.re, Waifu.im, Waifu.pics and shibe.online\n\nWarning: You might see naughty images",
"InternalName": "Neko",
"AssemblyVersion": "1.2.1",
"AssemblyVersion": "1.2.2",
"RepoUrl": "https://github.com/Meisterlala/NekoFans",
"ApplicableVersion": "any",
"Tags": [
Expand Down
6 changes: 5 additions & 1 deletion Neko/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ public class Plugin : IDalamudPlugin
DefaultRequestHeaders = {
UserAgent =
{
new($"NekoFans/{Assembly.GetExecutingAssembly().GetName().Version?.ToString()}(a Plugin for Final Fantasy XIV)"),
new("NekoFans", Assembly.GetExecutingAssembly().GetName().Version?.ToString()),
new("(a Plugin for Final Fantasy XIV)")
},
},
};
Expand Down Expand Up @@ -80,6 +81,9 @@ public void Dispose()
{
CommandManager.RemoveHandler(CommandConfig);
CommandManager.RemoveHandler(CommandMain);

// Stop loading images
GuiMain?.Slideshow?.Stop();
}

public static void UpdateImageSource() => ImageSource.UpdateFrom(Config.LoadSources());
Expand Down

0 comments on commit a1a9fa5

Please sign in to comment.