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

URL for noRemindersBehavior #181

Open
EnricoBara opened this issue Oct 7, 2022 · 0 comments
Open

URL for noRemindersBehavior #181

EnricoBara opened this issue Oct 7, 2022 · 0 comments

Comments

@EnricoBara
Copy link

EnricoBara commented Oct 7, 2022

Like the noEventBehavior clickable label, I'd like to suggest to add the url on noRemindersBehavior label. Here's the part I modified, tested and working fine

// Display reminders on the widget.
  async reminders(column) {    
    if (!this.data.reminders) { await this.setupReminders() }
    const reminderSettings = this.settings.reminders
    
    const settingUrl = reminderSettings.url || ""
    
    if (this.data.reminders.length == 0) {
      if (reminderSettings.noRemindersBehavior == "message" && this.localization.noRemindersMessage.length) { return this.provideText(this.localization.noRemindersMessage, column, this.format.noReminders, true, settingUrl ? reminderSettings.url : "x-apple-reminderkit://REMCDReminder/") }
      if (this[reminderSettings.noRemindersBehavior]) { return await this[reminderSettings.noRemindersBehavior](column) }
    }
    
    const reminderStack = column.addStack()
    reminderStack.layoutVertically()
    reminderStack.setPadding(0, 0, 0, 0)
    
    reminderStack.url = (settingUrl.length > 0) ? settingUrl : "x-apple-reminderkit://REMCDReminder/"    
      
    const numberOfReminders = this.data.reminders.length
    const showListColor = reminderSettings.showListColor
    const colorShape = showListColor.includes("circle") ? "circle" : "rectangle"

    for (let i = 0; i < numberOfReminders; i++) {
      const reminder = this.data.reminders[i]

      const titleStack = this.align(reminderStack)
      titleStack.layoutHorizontally()
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