Skip to content

Commit 49ecd67

Browse files
AureliusAurelius
authored andcommitted
fix: Root URL redirect and HealthIcons display
- Add index.html to redirect root URL to taskpane.html - Fix validIcons filter to treat CDN-based icons as always valid - HealthIcons now shows correct count and Load More button - Remove duplicate hasCdn declaration
1 parent 5205ff6 commit 49ecd67

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

scripts/build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ console.log('Building Slides Icons add-in...\n');
2020
function copyTaskpane() {
2121
console.log('Copying taskpane files...');
2222

23-
const files = ['taskpane.html', 'taskpane.css', 'taskpane.js'];
23+
const files = ['taskpane.html', 'taskpane.css', 'taskpane.js', 'index.html'];
2424
const srcDir = path.join(SRC_DIR, 'taskpane');
2525

2626
files.forEach(file => {

src/taskpane/index.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<html>
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta http-equiv="refresh" content="0; url=taskpane.html">
7+
<title>Redirecting...</title>
8+
</head>
9+
10+
<body>
11+
<p>Redirecting to <a href="taskpane.html">Slides Icons</a>...</p>
12+
</body>
13+
14+
</html>

src/taskpane/taskpane.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,11 @@ function renderIcons() {
157157
displayLimit = 100;
158158
}
159159

160-
// Count valid icons (with actual SVG content)
161-
const validIcons = icons.filter(icon => {
160+
// Count valid icons (with actual content)
161+
// CDN-based manifests: all icons are valid (fetched from CDN)
162+
// Embedded SVG manifests: check for valid svg content
163+
const hasCdn = !!currentManifest.cdnPattern;
164+
const validIcons = hasCdn ? icons : icons.filter(icon => {
162165
if (typeof icon.svg === 'string') return true;
163166
if (icon.svg && typeof icon.svg.content === 'string') return true;
164167
return false;
@@ -183,8 +186,7 @@ function renderIcons() {
183186
return;
184187
}
185188

186-
// Check if manifest uses CDN pattern or embedded SVG
187-
const hasCdn = !!currentManifest.cdnPattern;
189+
// hasCdn already declared above
188190

189191
grid.innerHTML = displayIcons.map(icon => {
190192
if (hasCdn) {

0 commit comments

Comments
 (0)