<commit_before># BASE SCRIPT
#================================

# for subdomains
document.domain = CONFIG.host

# ↓ iOS待ちPolyfill (SEE: http://caniuse.com/#feat=fetch)
require \fetch

# ↓ NodeList、HTMLCollectionで forEach を使えるようにする
if NodeList.prototype.for-each == undefined
	NodeList.prototype.for-each = Array.prototype.for-each
if HTMLCollection.prototype.for-each == undefined
	HTMLCollection.prototype.for-each = Array.prototype.for-each

# Load common dependencies
#--------------------------------

riot = require \riot
require \velocity

# Define common tags
#--------------------------------

require './common/tags.ls'

# Boot
#--------------------------------

log = require './common/scripts/log.ls'

fetchme = require './fetchme.ls'
mixins = require './mixins.ls'
panic = require './panic.ls'
check-for-update = require './common/scripts/check-for-update.ls'

log "Misskey (aoi) v:#{VERSION}"

# Check for Update
check-for-update!

# Get token from cookie
i = ((document.cookie.match /i=(\w+)/) || [null null]).1

if i? then log "ME: #{i}"

module.exports = (callback) ~>
	# Get cached account data
	cached-me = JSON.parse local-storage.get-item \me

	if cached-me? and cached-me.data.cache
		fetched cached-me

		# 後から新鮮なデータをフェッチ
		fetchme i, (fresh-data) ~>
			Object.assign cached-me, fresh-data
			cached-me.trigger \updated
	else
		# キャッシュ無効なのにキャッシュが残ってたら掃除
		if cached-me?
			local-storage.remove-item \me

		fetchme i, fetched

	function fetched me

		if me?
			riot.observable me

			if me.data.cache
				local-storage.set-item \me JSON.stringify me

				me.on \updated ~>
					# キャッシュ更新
					local-storage.set-item \me JSON.stringify me

			log "Fetched! Hello #{me.username}."

		# activate mixins
		mixins me
<commit_msg>Fix bug<commit_after># BASE SCRIPT
#================================

# for subdomains
document.domain = CONFIG.host

# ↓ iOS待ちPolyfill (SEE: http://caniuse.com/#feat=fetch)
require \fetch

# ↓ NodeList、HTMLCollectionで forEach を使えるようにする
if NodeList.prototype.for-each == undefined
	NodeList.prototype.for-each = Array.prototype.for-each
if HTMLCollection.prototype.for-each == undefined
	HTMLCollection.prototype.for-each = Array.prototype.for-each

# Load common dependencies
#--------------------------------

riot = require \riot
require \velocity

# Define common tags
#--------------------------------

require './common/tags.ls'

# Boot
#--------------------------------

log = require './common/scripts/log.ls'

fetchme = require './fetchme.ls'
mixins = require './mixins.ls'
panic = require './panic.ls'
check-for-update = require './common/scripts/check-for-update.ls'

log "Misskey (aoi) v:#{VERSION}"

# Check for Update
check-for-update!

# Get token from cookie
i = ((document.cookie.match /i=(\w+)/) || [null null]).1

if i? then log "ME: #{i}"

module.exports = (callback) ~>
	# Get cached account data
	cached-me = JSON.parse local-storage.get-item \me

	if cached-me?.data?.cache
		fetched cached-me

		# 後から新鮮なデータをフェッチ
		fetchme i, (fresh-data) ~>
			Object.assign cached-me, fresh-data
			cached-me.trigger \updated
	else
		# キャッシュ無効なのにキャッシュが残ってたら掃除
		if cached-me?
			local-storage.remove-item \me

		fetchme i, fetched

	function fetched me

		if me?
			riot.observable me

			if me.data.cache
				local-storage.set-item \me JSON.stringify me

				me.on \updated ~>
					# キャッシュ更新
					local-storage.set-item \me JSON.stringify me

			log "Fetched! Hello #{me.username}."

		# activate mixins
		mixins me

{'fraction_non_alphanumeric': 0.19533275713050993, 'fraction_numerical': 0.0005762028233938346, 'mean_word_length': 2.7780195865070727, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7406661', 'n_tokens_mistral': 1303, 'n_tokens_neox': 1188, 'n_words': 281}