Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Icon's don't auto show for new notes created via obsidian sync #562

Open
shawndibble opened this issue Sep 14, 2024 · 0 comments
Open

Icon's don't auto show for new notes created via obsidian sync #562

shawndibble opened this issue Sep 14, 2024 · 0 comments

Comments

@shawndibble
Copy link

shawndibble commented Sep 14, 2024

Describe the bug
When creating a note via a template on mobile and utilizing obsidian sync, the icon does not show when I go to my desktop obsidian without doing a reload/restart of the app. Or without having to change one of the iconizer meta values manually.

To Reproduce
Steps to reproduce the behavior:

  1. Have mobile and desktop setup with obsidian sync.
  2. Create a template that has icon and iconColor meta data on mobile.
  3. View the note on a desktop app (it has no icon showing).

Expected behavior
When the note syncs with my desktop, it should show the icon. As per Zachatoo in this descord message, we should utilize onExternalSettingsChange API to reload the app/note. Discord Link

Below is a snippet of my template that I use:

---
<%*
const fileName = tp.file.title;

const date = moment(fileName, "YYYY-MM-DD");

// Calculate previous and next days
const previousDay = date.clone().subtract(1, 'days').format("YYYY-MM-DD");
const nextDay = date.clone().add(1, 'days').format("YYYY-MM-DD");
const dayOfWeek = date.clone().format("dddd");

// Format the dates for the links
const yearPrev = date.clone().subtract(1, 'days').format("YYYY");
const monthPrev = date.clone().subtract(1, 'days').format("MM-MMMM");
const yearNext = date.clone().add(1, 'days').format("YYYY");
const monthNext = date.clone().add(1, 'days').format("MM-MMMM");

const colors = {
	"Sunday": "f94144",
	"Monday": "f3722c",
	"Tuesday": "fd9e02",
	"Wednesday": "f9c74e",
	"Thursday": "90be6d",
	"Friday": "43aa8b",
	"Saturday": "577590"
};

%>
created: <% tp.file.creation_date() %>
tags:
  - Daily-Notes
icon: LiCalendarDays
iconColor: "<% colors[dayOfWeek] %>"
---
# <% date.clone().format("dddd, MMMM DD, YYYY") %>

<< [[Daily Journal/<% yearPrev %>/<% monthPrev %>/<% previousDay %>|Previous Day]] | [[Daily Journal/<% yearNext %>/<% monthNext %>/<% nextDay %>|Next Day]] >>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant