Skip to content

Commit 080e361

Browse files
committed
Remove not working background license validation
1 parent 36a5782 commit 080e361

1 file changed

Lines changed: 0 additions & 54 deletions

File tree

src/Core.js

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -114,53 +114,6 @@ function cmdPager(pager_variable, layoutParadigm = 'rows') {
114114
applyPagerNumbers(groupedNodes, layoutParadigm, pager_variable, allNodes)
115115
}
116116

117-
/**
118-
* Validates stored license on startup without blocking initialization
119-
* If license is invalid, unlinks it and notifies user
120-
* @param {object} license - The stored license data
121-
*/
122-
function validateStoredLicense(license) {
123-
if (!license || !license.licensed || !license.licenseKey) {
124-
return Promise.resolve() // No license to validate
125-
}
126-
127-
console.log('[Core] Validating stored license on startup...')
128-
129-
return validateLicenseOnly(license.licenseKey)
130-
.then(result => {
131-
if (!result.ok) {
132-
// Only invalidate license if we got a clear license error from the API
133-
if (result.isLicenseError) {
134-
console.warn('[Core] License is invalid according to API:', result.error)
135-
136-
// Unlink invalid license
137-
return Storage.set(Storage.getKey('LICENSE_V1'), null)
138-
.then((success) => {
139-
if (success) {
140-
setCachedLicenseStatus(null)
141-
// Notify user with clear message
142-
figma.notify(`License unlinked: ${result.error}. Please reactivate in the License tab.`)
143-
} else {
144-
figma.notify('Failed to unlink license. Please try again.')
145-
}
146-
})
147-
} else if (result.isNetworkError) {
148-
console.warn('[Core] Network error during license validation, keeping license active:', result.error)
149-
// Don't invalidate license on network errors - maintain optimistic UI
150-
} else {
151-
console.warn('[Core] Unknown error during license validation, keeping license active:', result.error)
152-
// For any unknown errors, keep license active to avoid false invalidation
153-
}
154-
} else {
155-
console.log('[Core] Stored license validated successfully')
156-
}
157-
})
158-
.catch(error => {
159-
console.warn('[Core] Unexpected error during license validation, keeping license active:', error)
160-
// This catch should rarely be hit now, but if it is, keep license active
161-
})
162-
}
163-
164117
// Obtain UUID, preferences, and license then trigger init event
165118
Storage.getMultiple([
166119
Storage.getKey('UUID'),
@@ -200,13 +153,6 @@ Storage.getMultiple([
200153

201154
// Cache license status for gate decisions
202155
setCachedLicenseStatus(license)
203-
204-
// Validate stored license in background (non-blocking, optimistic UI)
205-
if (license && license.licensed) {
206-
validateStoredLicense(license).catch(error => {
207-
console.error('[Core] License validation error:', error)
208-
})
209-
}
210156

211157
// legacy spacing preference
212158
if (typeof spacing != 'undefined') {

0 commit comments

Comments
 (0)