on main help sign in
chore(permissions): no need to generate a cache key
9275e77Andrey Nering
internal/tui/components/dialogs/permissions/permissions.go+1−15
@@ -273,22 +273,9 @@ func (p *permissionDialogCmp) renderHeader() string {
273 return baseStyle.Render(lipgloss.JoinVertical(lipgloss.Left, headerParts...))
273 return baseStyle.Render(lipgloss.JoinVertical(lipgloss.Left, headerParts...))
274}
274}
275
275
276−func (p *permissionDialogCmp) generateContentKey() string {
277− return fmt.Sprintf("%s_%s_%t_%d_%d_%d_%d",
278− p.permission.ID,
279− p.permission.ToolName,
280− p.diffSplitMode,
281− p.diffXOffset,
282− p.diffYOffset,
283− p.contentViewPort.Width(),
284− p.contentViewPort.Height())
285−}
286−
287func (p *permissionDialogCmp) getOrGenerateContent() string {
276func (p *permissionDialogCmp) getOrGenerateContent() string {
288− currentKey := p.generateContentKey()
289−
290 // Return cached content if available and not dirty
277 // Return cached content if available and not dirty
291− if !p.contentDirty && p.cachedContentKey == currentKey && p.cachedContent != "" {
278+ if !p.contentDirty && p.cachedContent != "" {
292 return p.cachedContent
279 return p.cachedContent
293 }
280 }
294
281
@@ -309,7 +296,6 @@ func (p *permissionDialogCmp) getOrGenerateContent() string {
309
296
310 // Cache the result
297 // Cache the result
311 p.cachedContent = content
298 p.cachedContent = content
312− p.cachedContentKey = currentKey
313 p.contentDirty = false
299 p.contentDirty = false
314
300
315 return content
301 return content