Skip to content

Commit

Permalink
V1.5.2 (#74)
Browse files Browse the repository at this point in the history
* Clicking the plugin icon when no updates are available now shows a small message making it clearer that everything's up-to-date. The cursor no longer disappears when hovering over the plugin icon (Cursor style is set to "none" #72)

* Updates the description for the setting Minimum update count to show a plugin icon to mention that updates for this plugin are always shown (in-case there's a bug preventing you from seeing other updates) (#67)

* Clearer message when your IP address exceeds github's limit of 60 file downloads per hour when updating plugins. The number of minutes until the limit is reset is included in the message (Many plugins refuse update - while others did fine #73)

* Cleans-up some error logs in the developer console (Error when no internet connection  #68)

* Increases the max number of your installed plugins checked for updates from 350 to 400 (if this is still too low then let me know)
  • Loading branch information
swar8080 authored Aug 12, 2023
1 parent 8f506b0 commit 0590e5d
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 23 deletions.
2 changes: 1 addition & 1 deletion backend/aws/obsidian-plugin-update-checker-resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class ObsidianPluginUpdaterStack extends cdk.Stack {
entry: path.join(__dirname, '../get-releases-lambda/src/handler.ts'),
handler: 'main',
memorySize: 150,
timeout: Duration.seconds(90),
timeout: Duration.seconds(120),
runtime: lambda.Runtime.NODEJS_16_X,
architecture: lambda.Architecture.ARM_64,
environment: {
Expand Down
2 changes: 1 addition & 1 deletion manifest-beta.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "obsidian-plugin-update-tracker",
"name": "Plugin Update Tracker",
"version": "1.5.1",
"version": "1.5.2",
"minAppVersion": "0.15.0",
"description": "Know when installed plugins have updates and evaluate the risk of upgrading",
"author": "Obsidian",
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "obsidian-plugin-update-tracker",
"name": "Plugin Update Tracker",
"version": "1.5.1",
"version": "1.5.2",
"minAppVersion": "0.15.0",
"description": "Know when installed plugins have updates and evaluate the risk of upgrading",
"author": "Obsidian",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "obsidian-plugin-update-tracker",
"version": "1.5.1",
"version": "1.5.2",
"description": "Know when installed plugins have updates and evaluate the risk of upgrading",
"main": "main.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/components/PluginUpdateProgressTracker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const PluginUpdateProgressTracker: React.FC<{
let errorInstructions = '';
if (githubRateLimitTimestamp) {
const time = dayjs(githubRateLimitTimestamp);
errorInstructions = `Try again ${time.fromNow()}, and if that doesn't fix it then report an issue `;
errorInstructions = `Your IP address has exceeded github's limit of 60 file downloads in an hour. The limit will reset in ${time.fromNow()}, but if that doesn't work then report an issue`;
} else {
errorInstructions = `Try again or report an issue `;
}
Expand Down
45 changes: 29 additions & 16 deletions src/components/UpdateStatusIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { faPlug } from '@fortawesome/free-solid-svg-icons/faPlug';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { Notice } from 'obsidian';
import * as React from 'react';
import styled from 'styled-components';
import { useAppSelector } from '../state';
Expand All @@ -11,6 +12,7 @@ interface UpdateStatusIconContainerProps {
}

const CSS_CLASS_BASE = 'plugin-update-tracker-icon';
const TOAST_DELAY_MS = 5000;

const UpdateStatusIconContainer: React.FC<UpdateStatusIconContainerProps> = ({
onClickViewUpdates,
Expand Down Expand Up @@ -49,13 +51,31 @@ const UpdateStatusIconContainer: React.FC<UpdateStatusIconContainerProps> = ({
parentEl,
]);

function handlePluginIconClicked() {
if (isLoading) {
return;
} else if (isErrorLoading) {
new Notice(
'Error checking for plugin updates. Please check your internet connection and report an issue on github if the issue continues',
TOAST_DELAY_MS
);
} else if (pluginsWithUpdates.length > 0) {
onClickViewUpdates();
} else {
new Notice(
"Up-to-date! There aren't any plugin updates ready based on the filters configured in this plugin's settings.",
TOAST_DELAY_MS
);
}
}

return (
<>
<UpdateStatusIconView
isLoading={isLoading}
isErrorLoading={isErrorLoading}
pluginsWithUpdatesCount={pluginsWithUpdates.length}
onClickViewUpdates={onClickViewUpdates}
onPluginIconClicked={handlePluginIconClicked}
/>
</>
);
Expand All @@ -65,11 +85,11 @@ type UpdateStatusIconViewProps = {
isLoading: boolean;
isErrorLoading: boolean;
pluginsWithUpdatesCount: number;
onClickViewUpdates: () => any;
onPluginIconClicked: () => any;
};

export const UpdateStatusIconView: React.FC<UpdateStatusIconViewProps> = ({
onClickViewUpdates,
onPluginIconClicked,
isLoading,
isErrorLoading,
pluginsWithUpdatesCount,
Expand All @@ -83,8 +103,8 @@ export const UpdateStatusIconView: React.FC<UpdateStatusIconViewProps> = ({
let width = '0.5rem';
let padding = '0.3rem';
let cursor: string = 'pointer';
let isPluginUpdatesAvailable = false;
let title;
let isClickable = false;
let cssSelector;
if (isLoading) {
chipText = '⌛';
Expand Down Expand Up @@ -112,31 +132,24 @@ export const UpdateStatusIconView: React.FC<UpdateStatusIconViewProps> = ({
title = `${pluginsWithUpdatesCount} plugin update${
pluginsWithUpdatesCount > 1 ? 's' : ''
} available`;
isClickable = true;
isPluginUpdatesAvailable = true;
cssSelector = `${CSS_CLASS_BASE}--updates-available`;
} else {
chipText = '✓';
chipColour = '#197300';
title = 'All plugins up-to-date';
cursor = 'none';
cssSelector = `${CSS_CLASS_BASE}--no-updates-available`;
cursor = 'default';
}

const isHighlighted = isMouseOver && isClickable;

const handleClick = () => {
if (isClickable) {
onClickViewUpdates();
}
};
const isHighlighted = isMouseOver && isPluginUpdatesAvailable;

return (
<DivContainer
onClick={handleClick}
onClick={onPluginIconClicked}
cursor={cursor}
title={title}
aria-label={title}
aria-label-position="top"
data-tooltip-position="top"
onMouseOver={() => setIsMouseOver(true)}
onMouseLeave={() => setIsMouseOver(false)}
isHighlighted={isHighlighted}
Expand Down
5 changes: 4 additions & 1 deletion src/domain/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ export const getReleases: ReleaseApi = async (newPluginVersionRequest: NewPlugin
});
return JSON.parse(res);
} catch (err) {
console.error('Error fetching releases', err);
console.warn(
`Failed checking for plugin updates at ${BACKEND_API_URL}. Check your internet connection and security settings or file a bug at https://github.com/swar8080/obsidian-plugin-update-tracker/issues.\nError details are:\n`,
err
);
throw err;
}
};
Expand Down
3 changes: 2 additions & 1 deletion versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
"1.4.5": "0.15.0",
"1.4.6": "0.15.0",
"1.5.0": "0.15.0",
"1.5.1": "0.15.0"
"1.5.1": "0.15.0",
"1.5.2": "0.15.0"
}

0 comments on commit 0590e5d

Please sign in to comment.